Interface JsonSchemaProcessorOptions

interface JsonSchemaProcessorOptions {
    allowInheritance?: boolean;
    disableCache?: boolean;
    discriminator?: string;
    ignoreAdditionalItems?: boolean;
    ignoreAdditionalProperties?: boolean;
    interpretSingleEnumAsConst?: boolean;
    propertyNameForAdditionalProperties?: string;
}

Hierarchy

  • InterpreterOptions
    • JsonSchemaProcessorOptions

Properties

allowInheritance?: boolean
disableCache?: boolean

This options disables the seenSchemas cache in the Interpreter. Use this option to disable the seenSchemas cache when interpreting schemas. This will affect merging of schemas, and should only be used by the internal interpreters when allowInheritance is set to true. This allows the internal interpreters to keep clean copies of the schemas as CommonModel's.

discriminator?: string

When interpreting a schema with discriminator set, this property will be set best by the individual interpreters to make sure the discriminator becomes an enum.

ignoreAdditionalItems?: boolean

For JSON Schema draft 7, additionalItems are by default true, but it might create an unintended types for arrays.

Use this option to ignore default additionalItems for models, as long as there is other types sat for the array.

ONLY use this option if you do not have control over the schema files you use to generate the models from. Instead you should adapt your schemas to be more strict by setting additionalItems: false.

ignoreAdditionalProperties?: boolean

For JSON Schema draft 7, additionalProperties are by default true, but it might create an unintended property for the models.

Use this option to ignore default additionalProperties for models that has other properties with them.

ONLY use this option if you do not have control over your schema files. Instead adapt your schemas to be more strict by setting additionalProperties: false.

interpretSingleEnumAsConst?: boolean

This option enables that a single enum value {enum: ['test']} is interpreted the same as if the value was {const: 'test'} Use this option to reduce the number of enums being created and use constant values instead.

propertyNameForAdditionalProperties?: string

This option changes which property name that should be used to represent additionalProperties in JSON Schema