Skip to content

Changes in 'example', "examples" are not handled #666

Closed

Description

@DrSatyr

'example' and "examples" fields in OpenAPI objects (eg Parameter, Schema, MediaType, Header) are not compared.

Old schema:

schema:
    type: string,
    example: old example

New schema:

schema:
    type: string,
    example: new example

Such fields are not valuable for API functionality, but they are important from an API documentation perspective. Descriptions are already handled, so my suggestion is to handle examples as well.

Activity

  1. mhiggins-SA commented on Jun 1, 2024

    @mhiggins-SA
  2. DrSatyr commented on Jun 2, 2024

    @DrSatyr
    CollaboratorAuthor

    @mhiggins-SA Sorry, it's my bad, the provided schemas did not explain all the cases. For sure OAS 3.1 introduces "examples" in favor of deprecated "example". But openapi-diff works with all versions of specifications (Swagger 2.0, OAS 3.0, OAS 3.1).

    Basically, I would say that openapi-diff does not handle "examples" and "example" in all versions of the specification. Currently, I am working on PR to solve this, so will cover all versions.

  3. added this to the 2.1.0 milestone on Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions