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 have a use-case where we decide to include/exclude certain properties from the schema based on a global flag.
My current workaround is to use a custom ISchemaProcessor to strip properties. However, that requires iterating through all properties of the ContextualType, generating a name for the property, and then remove it from the property dictionary:
In the example above, CustomIgnore will only take effect if flag is being set to true.
Maybe there is a more elegant way. Currently the awkwardness mainly stems from not being able to get a JsonSchemaProperties's associated ContextualPropertyInfo. Maybe we can include it in the schema (as a nullable property because schemas aren't necessarily created from types).
The text was updated successfully, but these errors were encountered:
ph3rin
changed the title
Support conditionally (i.e. via a global flag) excluding properties in schema generation
Support conditionally (e.g. via a global flag) excluding properties in schema generation
Dec 22, 2024
I have a use-case where we decide to include/exclude certain properties from the schema based on a global flag.
My current workaround is to use a custom
ISchemaProcessor
to strip properties. However, that requires iterating through all properties of theContextualType
, generating a name for the property, and then remove it from the property dictionary:In the example above,
CustomIgnore
will only take effect ifflag
is being set to true.Maybe there is a more elegant way. Currently the awkwardness mainly stems from not being able to get a
JsonSchemaProperties
's associatedContextualPropertyInfo
. Maybe we can include it in the schema (as a nullable property because schemas aren't necessarily created from types).The text was updated successfully, but these errors were encountered: