openapi-to-postman
                                
                                 openapi-to-postman copied to clipboard
                                
                                    openapi-to-postman copied to clipboard
                            
                            
                            
                        Importing Multi-example response
when i try to import a multi-example response, is only importing the first response.
OPENAPI 3.0.0 EXAMPLE
openapi: "3.0.0"
info:
  title: ExampleApi
  description: Example Api
  version: 1.0.0
  contact:
    name: support
    email: [email protected]
servers:
  - url: http://example.com
    description: example server
paths:
  /users:
    post:
      description: Create User
      summary: Create User
      responses:
        '201':  
          description: Return a User Object
          content: 
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: integer
                  name:
                    type: string
              examples:
                John-Ok-Example:
                  summary: Success create of John User
                  description: Success create of John User
                  value:
                    id: 1
                    name: John Doe
                Jane-Ok-Example:
                  summary: Success create of Jane User
                  description: Success create of Jane User
                  value:
                    id: 2
                    name: Jane Doe
Postman Versión

Postman Collection

Postman Example

Referencia
See: /lib/utils.js function getExampleData
This would be a very useful improvement for us too! Any update on it?
May I try to slay this bug @umeshp7 ?
Go ahead @ProBeta1. Should I assign this to you?
Okay @umeshp7 :)
Was bit busy with the gsoc proposal work, hence the delay .
So here is what I think is the cause of bug :   getExampleData() , this function is made to return only first example from the input map , because it is used by the function convertToPmBodyData to generate postman data. So should I just make the getExampleData() function return the entire Object @umeshp7 ?
Or something else is causing this issue ?
+1
Has this been fixed?
@umeshp7 could i take this up?
Hi, Any update on this ? It would be really useful to us too !
This feature is really important for any serious user of APIs. Who can live with just one example? @umeshp7 @ProBeta1 @mdaj06 Any update? I would love to complete my CI Pipeline with Quarkus -> OpenApi-Export -> PostMan Import -> NewMan for automated REST testing.
@VShingala @umeshp7 can I work on this?
Duplicate of https://github.com/postmanlabs/openapi-to-postman/issues/425 Is there any update?
We've added support for this with latest Postman App v10.19 and this module. Please give it a try and let us know your feedback.
Here's brief overview of how this will work.
- If request body and response body both have an example with the same example key, we'll create a separate example with matching request and response body.
- If request body and response body example key doesn't match, we'll try to create a matching based on the order or mention of these examples. i.e. 1st example will contain 1st request body example and 1st response body example in it.
- If after above, we have request or response bodies without matching, we'll use the existing behavior of using the first example. (Note that, we'll create one separate example for each example for both the request body and response body even if matches are not found)