Skip to content

JsonSchemaGeneratorSettings

Rico Suter edited this page Jan 18, 2020 · 26 revisions

Settings for the JsonSchemaGenerator.

Properties:

JSON shape:

  • SerializerSettings
  • ExcludedTypeNames
  • IgnoreObsoleteProperties
  • GenerateEnumMappingDescription

Type handling

  • DefaultReferenceTypeNullHandling
  • DefaultDictionaryValueReferenceTypeNullHandling
  • GenerateKnownTypes: Specifies whether to generate schemas for types in KnownTypeAttribute attributes.
  • FlattenInheritanceHierarchy: Value indicating whether to flatten the inheritance hierarchy instead of using allOf to describe inheritance (default: false).
  • GenerateAbstractProperties

Transformations

  • TypeMappers
  • SchemaProcessors
  • TypeNameGenerator
  • SchemaNameGenerator

Schema features

  • GenerateXmlObjects
  • GenerateExamples
  • GenerateCustomNullableProperties
  • AlwaysAllowAdditionalObjectProperties

Internal

  • ReflectionService
  • SchemaType (used in NSwag)
  • AllowReferencesWithProperties

Obsolete (should be controlled with the SerializerSettings property)

  • ContractResolver
  • DefaultEnumHandling: The default enum handling (default: Integer).
  • DefaultPropertyNameHandling: The default property name handling:
    • Default: Generates property name using reflection (respecting the JsonPropertyAttribute and DataMemberAttribute).
    • CamelCase: Generates lower camel cased property names using CamelCasePropertyNamesContractResolver.
Clone this wiki locally