The library allows you to parse JSON string in to object. If any of field won't be filled by json structure an Exception will throw.
There is only one static generic function in a library
var model = SettingsProcessor.Process<ModelClass>(jsonString);
If your model assume to have fields which could be filled or not you can always use the [Optional]
attribute. In this case if your json string is not contain the field, exception won't be threw.
public ModelClass {
//....
[Optional]
public string OptionalProperty { get; set; }
//....
}
- JsonStringEmptyException - Throws when json string null or empty
- IncorrectJsonFormatException - Throws when json string has incorrect format
- RequaredFieldEmptyException - Throws when json string miss to fill any field. The Field name stores into the exception.
You will see the The field "{FieldName}" empty in a json file.
message in an exeption. It should help you make a trouble shooting.