FAQ

  • GitHub GitHub Repo stars
  • Discord Discord Server
  • ✨ New! Try the OpenAPI Doctor ✨ The OpenAPI Doctor
    Recommended

    oas3-example-external-check


    Formats: Severity:

    Examples are really important. When defining an OpenAPI specification, it’s critical that every operation request and response have examples defined for them. The same applies to definitions defined as references.

    Examples help consumers of your API understand what real data should actually look like when sending requests, or listening for responses.

    Good examples are particularly valuable when data is complex, deep, nested or contains special formatting.

    Why did this violation appear?

    Examples can have an externalValue or a value, but they cannot have both.

    What is this rule checking for?

    The rule looks through the spec at the following elements, and checks that examples have been clearly defined for each.

    • All Schemas
    • All Parameters
    • All Headers
    • All Media Types

    How do I fix this violation?

    Do not use externalValue and value together in the same example.