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

[REQ][JAVA-WIREMOCK] support named examples #17725

Open
martin-mfg opened this issue Jan 27, 2024 · 0 comments
Open

[REQ][JAVA-WIREMOCK] support named examples #17725

martin-mfg opened this issue Jan 27, 2024 · 0 comments

Comments

@martin-mfg
Copy link
Contributor

The java-wiremock generator supports examples specified like this:

openapi: 3.0.3
info:
  version: 1.0.0
  title: OpenAPI Petstore
paths:
  /:
    get:
      responses:
        '200':
          description: successful operation
          content:
            application/json:
              schema:
                type: object
                properties:
                  dummyProp:
                    type: string
                    example: 'hello world' # this is supported

But it does not support examples specified like this:

openapi: 3.0.3
info:
 version: 1.0.0
 title: OpenAPI Petstore
paths:
 /:
   post:
     responses:
       '200':
         description: successful operation
     requestBody:
       content:
         application/json:
           schema:
             type: object
             properties:
               dummyProp:
                 type: string
             example: # this is not supported
               dummyProp: hello world

I suggest to add support for the latter as well.

Additional context

This was originally discussed in #17614.
There it was also explained what the current problem is:

It's the initial parsing that does not report named examples, so they don't end up being generated.

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

No branches or pull requests

1 participant