Agent Testing
FAQ
Autofix

  • GitHub GitHub Repo stars
  • Discord Discord Server
  • Recommended

    oas3-schema


    Formats: Severity:

    This rule validates the document against the OpenAPI 3.0, 3.1 or 3.2 schema built into libopenapi.

    What is this rule checking for?

    Required fields, permitted properties, value types and combinations of fields.

    Invalid combinations include:

    • Both example and examples on the same 3.1 Parameter or Media Type Object.
    • encoding with prefixEncoding or itemEncoding in 3.2, including nested encodings.
    • XML nodeType with attribute or wrapped in 3.2, even when set to false.
    • Invalid header names and prohibited allowReserved fields in 3.2.
    • description on a 3.2 Media Type Object.

    Null operations such as get: null fail schema validation. Use an Operation Object with the required fields.


    A Link Object can include server. Use requestBody for its request-body value. body is not a permitted field.

    components:
      links:
        next:
          operationId: listPets
          server:
            url: https://api.example.com
    

    The document relationships rule checks that listPets exists.


    Why did this violation appear?

    A field, value or combination of fields does not match the document’s OpenAPI version.

    How do I fix this violation?

    Correct the reported field. Use the diagnostic’s file, line and path to find it.

    Spectral Equivalent

    oas3-schema