Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple example set in OpenAPI schema doesn't work #913

Open
angeschw opened this issue Apr 25, 2024 · 0 comments
Open

Multiple example set in OpenAPI schema doesn't work #913

angeschw opened this issue Apr 25, 2024 · 0 comments

Comments

@angeschw
Copy link

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior.

Create an OpenAPI schema 3.0.0.
Use a repeated component in various responses.

// first path has a response with component
      responses:
        201:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MyRepeatedObject'
              example:
                id: 'mock_id'
                name: 'repeated_object_name'

// a different path later in the same file
      responses:
        200:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MyRepeatedObject'
              example:
                id: 'mock_id_2'
                name: 'repeated_object_name_2'

Actual behavior
A clear and concise description of what happens.

Presence of 1 example builds + validates fine. Presence of 2 example fails with no clear error from express-openapi-validator.
error: {}

Expected behavior
A clear and concise description of what you expected to happen.

Multiple examples should be allowed

Examples and context
An example or relevant context e.g. an OpenAPI snippet, an Express handler function snippet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant