Skip to content
This repository has been archived by the owner on Dec 27, 2024. It is now read-only.

Commit

Permalink
build: update deps and version
Browse files Browse the repository at this point in the history
  • Loading branch information
joolfe committed Jul 16, 2021
1 parent aa61018 commit 65991ee
Show file tree
Hide file tree
Showing 3 changed files with 1,914 additions and 1,982 deletions.
16 changes: 12 additions & 4 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -425,15 +425,23 @@ pm.response.to.have.status(201)
pm.expect(pm.response.code).to.eql(202)
```

The status code will be automatically parsed and used in the OpenAPI specification.

</div></div>
<div class="tilted-section"><div markdown="1">
The status code will be automatically parsed and used in the OpenAPI specification, take into account that feature [Responses parsed from Postman collection examples](#responses-parsed-from-postman-collection-examples) has priority over this feature.

## Responses parsed from Postman collection examples

As described in [Postman docs](https://learning.postman.com/docs/sending-requests/examples/) is possible to save real responses from a server or create manually responses to save as examples in a postman request, this examples contain all the information about the request (method, url, headers, parameters...) and the corresponding response (body, headers, status code...) and will be automatically parsed by `postman-to-openapi` and added as an operation [Response Object Example/Examples](https://swagger.io/specification/) in the result OpenAPI specification.

Note that this examples will be added in OpenAPI specification as a 'Operation Object > Responses Objects > content > Media Type Object > example or examples' and not as a schema.

Actually multiple examples in the same request are supported with the same or different status code response as OpenAPI support the description of more than one example. The Supported Media Types in this moment are `application/json` and `text/plain`.

Take into account that this feature has priority over the [Response status code parse from Test](#response-status-code-parse-from-test) one so if `postman-to-openapi` detect that some example exist in the postman collection will no parse the test script.

If there are more than one example at request level the used headers will be the ones that appear in the last example in the postman collection.

</div></div>
<div class="tilted-section"><div markdown="1">

# Postman collection examples

All the featured described in this doc are unit tested using real postman collections files as examples, we encourage you to use this collections files as an example of your own implementation.
Expand Down
Loading

0 comments on commit 65991ee

Please sign in to comment.