Reference
Validation rules
The ten semantic rules of the validator, what each one checks and its severity.
Rules run on the document as written for the target version, after the official schema check. Their classes are in
Ark4ne\OpenApiWriter\Validation\Rules; remove one with $validator->withoutRules(PathParametersRule::class).
UniqueOperationIdRule
error
Each
operationId is unique in the document.PathParametersRule
error
Each
{name} variable of a path has a matching required in: path parameter, on the path item or on every
operation.UniqueParametersRule
error
No two parameters of an operation, path item parameters included, share the same
name and in.LocalReferencesRule
error
Each local reference (
#/…) points to an existing element of the document: $ref, operationRef and the values of
a discriminator mapping. A $ref inside a schema with an $id is resolved in that schema, as JSON Schema does.
References to other documents and free values (example, default…) are not checked.SecurityRequirementsRule
error
Each security requirement names a declared security scheme, and asks only for OAuth2 scopes that its flows declare.
DeclaredTagsRule
warning
Each tag used by an operation is declared in the root
tags.TagParentsRule
error
From 3.2, each
Tag.parent names a declared tag, without cycle.EquivalentPathsRule
error
No two paths are equal once their variable names are ignored:
/users/{id} and /users/{uuid} conflict.NonEmptyDocumentRule
warning
The document declares at least one operation, in
paths or webhooks (x-webhooks before 3.1),
additionalOperations included. Path items of components do not count.ValueTypeRule
warning
Each
default and example of a schema matches its declared type. A schema without type accepts any value; in 3.0,
nullable: true accepts null. A number with a zero fraction (1.0) is an integer.Before these rules, the validator reports:
- every feature the version cannot express, which the
strict mode would throw, as errors of the rule
Serializer; when there is any, the validation stops there; - every violation of the official JSON schema of the version, when built with
OpisJsonSchemaValidator.