unique-properties-in-schema-required-list
Overview
This rule belongs to the openapi-v3-standards-validation
ruleset and states that:
A property can only be marked as required once in the list of required properties, specified using property required
of the Schema Object i.e. the items in this list must be unique.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Property is already marked as required. |
Code | OPENAPI3STANDARDS_V335 |
Type | Validation |
Rule System | Semantic |
Broad Category | Schemas |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | openapi3 openapi standards semantic validation required properties property name object json schema validation json schema |
Suggested Fixes
- Remove redundant entry for the property name in the list.
- Ensure that the items in the list are unique.
- Items in the list are compared in a case-sensitive manner.
For More Information
- https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#section-6.5.3
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#schema-object
- https://datatracker.ietf.org/doc/html/draft-wright-json-schema-validation-00#section-5.15
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#schema-object
- https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md#openapi-specification
- https://docs.apimatic.io/rulesets/overview/