corvus-dotnet / Corvus.JsonSchema

Support for Json Schema validation and entity generation
Apache License 2.0
99 stars 9 forks source link

Will setting a property to deprecated be shown in the generated model? #374

Closed challe closed 3 months ago

challe commented 3 months ago

A quick question that I was not able to find an answer to. If I say that a specific property is deprecated, will this be shown in the generated model on that property? It would very cool if it did! 😄

Example:

{
  "$schema": "https://json-schema.org/draft/2019-09/schema", 
  "type": "object",
  "properties": {
    "my_property": {
      "type": "string",
      "deprecated": true
    }
  }
}
mwadams commented 3 months ago

It was a trivial change to add the Obsolete attribute to the property when it is deprecated in the schema.

The enhancement is just going through our CI process and will be released in the next hour or so.