Skip to content

Latest commit

 

History

History
28 lines (22 loc) · 672 Bytes

readme.md

File metadata and controls

28 lines (22 loc) · 672 Bytes

no-single-allof

This rule validates that no SchemaObject with allOf property contains a single SchemaObject.

Examples of valid OpenAPI SchemaObject types

components:
    schemas:
        SomeApiResponse:
            type: "object"
            allOf: # <-- valid
                - $ref: "#/components/schemas/Foo"
                - $ref: "#/components/schemas/Bar"

Examples of invalid OpenAPI SchemaObject

SomeApiResponse object can be avoided by referring to Foo instead

components:
    schemas:
        SomeApiResponse:
            type: "object"
            allOf: # <-- invalid
                - $ref: "#/components/schemas/Foo"