Nucs / JsonSettings

This library simplifies creating configuration for your C# app/service by utilizing the serialization capabilities of Json.NET to serialize nested (custom) objects, dictionaries and lists as simply as by creating a POCO and inheriting JsonSettings class.
MIT License
76 stars 18 forks source link

Formatting.Indented #24

Closed ghost1372 closed 3 years ago

ghost1372 commented 3 years ago

after installing version 2 Alpha3 It seems that Formatting.Indented does not work version 2 alpha 3 1

version 2 alpha 2

0

Is there an option to enable it?

Nucs commented 3 years ago

image Formatting is passed via JsonSerializerSettings. The picture shows you the resolving logic. By default, all JsonSettings use static JsonSettings.SerializationSettings which has Formatting property with default value of Formatting.Indented. In-order to override setting specifically for an object, use instance mySettings.OverrideSerializerSettings or modify static JsonSettings.SerializationSettings.

Note that on next release it'll work appropriately. on release 2.0.0-alpha3 I accidentally override the Formatting.