widdershins icon indicating copy to clipboard operation
widdershins copied to clipboard

Support multiple `requestBody` examples

Open bobics opened this issue 5 years ago • 4 comments

Similar to how multiple response examples are already supported in Widdershins, it would great if it also support multiple requestBody examples.

Here's an example yaml:

   /foo:
    post:
      tags:
        - Foo
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                topic:
                  type: string              
            examples:
              oneRequest:
                description: one
                value:
                  topic: one
              twoRequest:
                description: two
                value:
                  topic: two
      responses:
        '200':
          description: success
          content:
            application/json:
              schema:
                type: object
                properties:
                  topic:
                    type: string              
              examples:
                oneResponse:
                  description: one
                  value:
                    topic: one
                twoResponse:
                  description: two
                  value:
                    topic: two

And what it looks like currently: screen shot 2018-11-12 at 3 17 10 pm

bobics avatar Nov 12 '18 23:11 bobics

It'd be super useful to have this feature 👍

badsyntax avatar Aug 03 '20 10:08 badsyntax

Hi @MikeRalphson,

I pushed https://github.com/Mermade/widdershins/pull/401 :) Would you have a look ?

sirinn avatar Nov 29 '20 19:11 sirinn

Hi @MikeRalphson would you accept a PR for this issue? I am planning to continue on the work from @sirinn to get it included.

ronan-f avatar Oct 26 '22 21:10 ronan-f

I went ahead and opened a PR. Please let me know what we can do to get this merged #530. Thanks!

ronan-f avatar Oct 26 '22 21:10 ronan-f