autorest

Prechecker

Prechecker is a step that runs before the modeler that will validate and fix up the OpenAPI spec.

Rules

Schema without type

Prechecker will look for schema that should be defined as type: "object" but are missing the type property. It will automatically inject the type: "object" field.

Note: This is a warning and was added for backward compatiblity. It is not recommended to omit the type: "object"

Schema with empty parent

Prechecker will look for schemas that use allOf referencing an empty schema. In that case it will remove the reference.

Duplicate schema

Prechecker will compare all the schemas and check for duplicates.

Properties

Prechecker will check redefinition of properties in child schemas. If a child schema redefine a property already defined in a parent schema(Using allOf). It will:

Duplicate parents

Prechecker will check that there isn’t duplication in the parent(allOf) tree. It will raise an error if there is.