<PackageReference Include="NJsonSchema" Version="10.3.2" />

JsonSchemaGeneratorSettings

The JSON Schema generator settings.

Gets the contract resolver.

Gets the serializer settings.

public bool AllowReferencesWithProperties { get; set; }

Gets or sets a value indicating whether to use $ref references even if additional properties are defined on the object (otherwise allOf/oneOf with $ref is used, default: false).

public bool AlwaysAllowAdditionalObjectProperties { get; set; }

Will set `additionalProperties` on all added JsonSchemaschema definitions and references(default: false).

public IContractResolver ContractResolver { get; set; }

Gets or sets the contract resolver.

Gets or sets the default reference type null handling of dictionary value types when no nullability information is available (default: NotNull).

public EnumHandling DefaultEnumHandling { get; set; }

Gets or sets the default enum handling (default: Integer).

Gets or sets the default property name handling (default: Default).

Gets or sets the default reference type null handling when no nullability information is available (default: Null).

public string[] ExcludedTypeNames { get; set; }

Gets or sets the excluded type names (same as JsonSchemaIgnoreAttribute).

public bool FlattenInheritanceHierarchy { get; set; }

Gets or sets a value indicating whether to flatten the inheritance hierarchy instead of using allOf to describe inheritance (default: false).

public bool GenerateAbstractProperties { get; set; }

Gets or sets a value indicating whether to generate abstract properties (i.e. interface and abstract properties. Properties may defined multiple times in a inheritance hierarchy, default: false).

public bool GenerateAbstractSchemas { get; set; }

Gets or sets a value indicating whether to generate the x-abstract flag on schemas (default: true).

public bool GenerateCustomNullableProperties { get; set; }

Gets or sets a value indicating whether to generate x-nullable properties (Swagger 2 only).

public bool GenerateEnumMappingDescription { get; set; }

Gets or sets a value indicating whether to generate a description with number to enum name mappings (for integer enums only, default: false).

public bool GenerateExamples { get; set; }

Gets or sets a value indicating whether to generate the example property of the schemas based on the <example> xml docs entry as JSON.

public bool GenerateKnownTypes { get; set; }

Gets or sets a value indicating whether to generate schemas for types in KnownTypeAttribute attributes (default: true).

public bool GenerateXmlObjects { get; set; }

Gets or sets a value indicating whether to generate xmlObject representation for definitions (default: false).

public bool IgnoreObsoleteProperties { get; set; }

Gets or sets a value indicating whether to ignore properties with the ObsoleteAttribute.

Gets or sets the reflection service.

Gets or sets the schema name generator.

Gets or sets the schema processors.

public SchemaType SchemaType { get; set; }

Gets or sets the schema type to generate (default: JsonSchema).

public object SerializerOptions { get; set; }

Gets or sets the System.Text.Json serializer options.

Gets or sets the Newtonsoft JSON serializer settings.

public ICollection<ITypeMapper> TypeMappers { get; set; }

Gets or sets the type mappings.

Gets or sets the type name generator.

Initializes a new instance of the JsonSchemaGeneratorSettings class.

Gets the actual computed FlattenInheritanceHierarchy setting based on the global setting and the JsonSchemaFlattenAttribute attribute.

Gets the actual computed GenerateAbstractSchemas setting based on the global setting and the JsonSchemaAbstractAttribute attribute.

Gets the contract for the given type.