Skip to content

Latest commit

 

History

History
29 lines (24 loc) · 775 Bytes

File metadata and controls

29 lines (24 loc) · 775 Bytes

no-empty-object-type

This rule validates that no SchemaObjects can be empty object types

Examples of valid OpenAPI SchemaObject types

components:
    schemas:
        SomeApiResponse:
            type: "object"
            properties: # <-- valid because properties are specified
                foo:
                    type: "string"
        SomeApiResponse:
            type: "object"
            allOf: # <-- valid because properties can be discovered via allOf
                - $ref: "#/components/schemas/Foo"
                - $ref: "#/components/schemas/Bar"

Examples of invalid OpenAPI SchemaObject

components:
    schemas:
        SomeApiResponse:
            type: "object" # <-- invalid because no properties are specified