Skip to content

Use OpenAPI examples #962

@mathilde-lannes

Description

@mathilde-lannes

Hello,

Thanks for all the great work on Mockoon, it's an amazing tool.

I'm using Mockoon to generate a mock server for my API, based on an OpenAPI spec file. I have examples for each endpoint response in my spec and I'd like to get one different possible response for each example in Mockoon.

For instance this endpoint has two examples :

  '/categories/{id}/activities':
    get:
      summary: List of activities
      tags:
        - categories
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/activities'
              examples:
                Sport:
                  value:
                    - id: 7
                      name: Basket-ball
                    - id: 8
                      name: Tennis
                Hobbies:
                  value:
                    - id: 9
                      name: Knitting

And I'd like to get this result in Mockoon when I import my OpenAPI specification file :

image

I saw on the discussion #519 that you don't support the examples OpenAPI property. Is supporting this property on your roadmap ?

Thanks again and have a great day!

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status

✅ Done (ready for next release)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions