Class JsonSchemaOptions
Options for JSON Schema generation.
public sealed class JsonSchemaOptions
- Inheritance
-
JsonSchemaOptions
- Inherited Members
- Extension Methods
Remarks
These options control how JSON Schemas are generated from .NET types, including support for custom schema annotations.
Properties
AllowAdditionalProperties
Gets or sets whether to allow additional properties in object schemas.
public bool AllowAdditionalProperties { get; set; }
Property Value
- bool
true to allow additional properties not defined in the schema; otherwise, false. Default is true.
IncludeAnnotations
Gets or sets whether to include schema annotations from attributes.
public bool IncludeAnnotations { get; set; }
Property Value
- bool
true to process SchemaDescriptionAttribute, SchemaExampleAttribute, and SchemaDeprecatedAttribute; otherwise, false. Default is false.
JsonSerializerOptions
Gets or sets custom JSON serializer options for schema generation.
public JsonSerializerOptions? JsonSerializerOptions { get; set; }
Property Value
- JsonSerializerOptions
Custom JsonSerializerOptions to use, or null to use the default options (camelCase, no indentation).
TreatNullObliviousAsNonNullable
Gets or sets whether to treat null-oblivious reference types as non-nullable.
public bool TreatNullObliviousAsNonNullable { get; set; }