Jsondyno is a C# library that allows you to use the dynamic
keyword to access JSON object properties without model classes.
Install NuGet package and add DynamicObjectJsonConverter
to JsonSerializerOptions
instance:
using Jsondyno;
var opts = new JsonSerializerOptions
{
Converters = { new DynamicObjectJsonConverter() }
};
string json = """
{
"MyProperty": 11
}
""";
dynamic obj = JsonSerializer.Deserialize<dynamic>(json, opts)!;
int myProperty = obj.MyProperty;
Console.WriteLine(myProperty); // Output: 11
Jsondyno uses System.Text.Json
library to parse JSON, so dynamic
object property name conversion fully satisfy configuration settings:
More usage topic can be found here.
When contributing to the Jsondyno repo, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.
Please note the code of conduct, please follow it in all your interactions with the project.
How to deal with security issues check security page.
Jsondyno is licensed under the MIT license.