Skip to content

Get any json response from API and generate a new json string from a simple dictionary<string, string> map

Notifications You must be signed in to change notification settings

RaulisonMendonca/json-to-json-map

Repository files navigation

json-to-json-map

Get any json response from API and generate a new json string from a simple dictionary<string, string> map

Fake data from: https://jsonplaceholder.typicode.com

How it works

Use a array response or single response to JObject

var json = await result.Content.ReadAsAsync<JObject[]>();

var json = await result.Content.ReadAsAsync<JObject>();

Execute a method with mapping columns:

var mapped = JMap.Bind(json, new Dictionary<string, string>
{
    {"userId", "userIdMap"},
    {"title", "titleMap"}
});

Results

Original

{
  "userId": 1,
  "id": 1,
  "title": "delectus aut autem",
  "completed": false
}

To Mapped

{
  "userIdMap": 1,
  "titleMap": "delectus aut autem"
}

About

Get any json response from API and generate a new json string from a simple dictionary<string, string> map

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages