You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using dotnet core 9 application.
I have appsettings.json config and from that config file our application load all config into IConfiguration object.
one of sub prop. of config file have following json schema.
How to to get json or read json schema from IConfiguration?
"DefaultJsonSchema": {
"type": "object",
"required": [ "value", "timestamp", "ts" ],
"properties": {
"value": {
"type": [ "string", "number", "boolean", "object", "array", "null" ],
"description": "A dynamic property that can accept multiple types",
"minLength": 1,
"maxLength": 256
},
"timestamp": {
"type": "string",
"format": "date-time",
"description": "A string representing the timestamp in ISO 8601 format"
},
"ts": {
"type": "integer",
"description": "A Unix timestamp as an integer"
},
"quality": {
"type": "array",
"items": {
"type": [ "string", "null" ]
},
"description": "An array of strings, allowing null values"
},
"others": {
"type": [ "string", "number", "boolean", "object", "array", "null" ],
"description": "A dynamic property that can accept multiple types"
}
}
}
The text was updated successfully, but these errors were encountered:
Unfortunately, this is non-trivial as IConfiguration is entirely dynamic under the covers. It doesn't actually expose "json" to you in any way - at least, not unless you encode the JSON as a string value.
In part, this is because it supports destructuring values e.g. via Environment Variables, and not just "JSON" config files.
I am using dotnet core 9 application.
I have
appsettings.json
config and from that config file our application load all config into IConfiguration object.one of sub prop. of config file have following json schema.
How to to get json or read json schema from IConfiguration?
The text was updated successfully, but these errors were encountered: