https://github.com/vsavik/jsondyno
Jsondyno is a C# library that leverages the dynamic keyword to provide intuitive and flexible access to JSON object properties.
https://github.com/vsavik/jsondyno
dynamic json serialization
Last synced: 5 months ago
JSON representation
Jsondyno is a C# library that leverages the dynamic keyword to provide intuitive and flexible access to JSON object properties.
- Host: GitHub
- URL: https://github.com/vsavik/jsondyno
- Owner: vsavik
- License: mit
- Created: 2023-12-28T15:11:35.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-21T22:07:05.000Z (over 1 year ago)
- Last Synced: 2025-10-05T22:10:03.538Z (9 months ago)
- Topics: dynamic, json, serialization
- Language: C#
- Homepage: https://github.com/vsavik/jsondyno
- Size: 227 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Security: .github/SECURITY.md
Awesome Lists containing this project
README
# Jsondyno
Jsondyno is a C# library that allows you to use the `dynamic` keyword to access JSON object properties without model classes.
## Quick start
Install [NuGet](https://www.nuget.org/packages/Jsondyno) package and add `DynamicObjectJsonConverter` to [`JsonSerializerOptions`](https://learn.microsoft.com/en-us/dotnet/api/system.text.json.jsonserializeroptions) instance:
```csharp
using Jsondyno;
var opts = new JsonSerializerOptions
{
Converters = { new DynamicObjectJsonConverter() }
};
string json = """
{
"MyProperty": 11
}
""";
dynamic obj = JsonSerializer.Deserialize(json, opts)!;
int myProperty = obj.MyProperty;
Console.WriteLine(myProperty); // Output: 11
```
*Jsondyno* uses [`System.Text.Json`](https://learn.microsoft.com/en-us/dotnet/api/system.text.json) library to parse JSON, so `dynamic` object property name conversion fully satisfy configuration settings:
- [JsonSerializerOptions.PropertyNamingPolicy](https://learn.microsoft.com/en-us/dotnet/api/system.text.json.jsonserializeroptions.propertynamingpolicy)
- [JsonSerializerOptions.PropertyNameCaseInsensitive](https://learn.microsoft.com/en-us/dotnet/api/system.text.json.jsonserializeroptions.propertynamecaseinsensitive)
More usage topic can be found [here](./docs/Usage.md).
## Documentation
- [How to use *Jsondyno*](./docs/Usage.md)
- [Advanced - *Jsondyno* internals](./docs/Advanced.md)
- [Benchmarks](./docs/Benchmarks.md)
- [Development Guides](./docs/Development.md)
## Contributing
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](.github/CODE_OF_CONDUCT.md), please follow it in all your interactions with the project.
How to deal with security issues check security [page](.github/SECURITY.md).
## License
Jsondyno is licensed under the [MIT](LICENSE) license.