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

Commit

Permalink
docs: update docs about responses
Browse files Browse the repository at this point in the history
  • Loading branch information
joolfe committed Jul 14, 2021
1 parent f514d74 commit aa61018
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* Contact and License from variables or by configuration.
* Provide meta-information as a markdown table.
* Path depth configuration.
* Response status code parse from test.
* API Response parse from postman examples and from test code (status code).
* [x-logo](https://github.com/Redocly/redoc/blob/master/docs/redoc-vendor-extensions.md#x-logo) extension support

See [Features](#features) section for more details about how to use each of this features.
Expand Down Expand Up @@ -119,6 +119,17 @@ See demo in next gif:

The third parameter used in the library method is an `options` object containing the optional parameters for the transformation, the allowed parameters are:

| Param | Description |
|------------------|------------------------------------------------------------------------------------|
| [info](#info-object) | Basic API information |
| [defaultTag](#defaulttag-string) | Values of the default tag object. |
| [pathDepth](#pathdepth-number) | Number of subpaths that should be part of the operation path. |
| [auth](#auth-object) | Global authorization definition object. |
| [servers](#servers-array) | Server list for the OpenApi specs. |
| [externalDocs](#externaldocs-object) | Info about the API external documentation. |
| [folders](#folders-object) | Config object for folders and nested folders in postman collection. |
| [responseHeaders](#responseheaders-boolean) | Indicate if should parse the response headers from the collection examples. |

### info (Object)

The basic information of the API is obtained from Postman collection as described in section [default info](#basic-api-info), but you can customize this parameters using the `info` options that can contain the next parameters:
Expand Down Expand Up @@ -299,6 +310,12 @@ Avoid concatenation
</div></div>
<div class="tilted-section"><div markdown="1">

### responseHeaders (Boolean)

This flag indicates if the headers that are saved as part of the postman collection examples (see feature [Responses parsed from Postman collection examples](#responses-parsed-from-postman-collection-examples)) should be used in the OpenApi specification. This headers normally contain lot of unused headers but are automatically saved by postman when create an example, a better approach is to define response headers in a common way.

The default value is `true`, so headers are by default added to the response definition.

# Features

## Basic conversion
Expand Down Expand Up @@ -413,6 +430,10 @@ The status code will be automatically parsed and used in the OpenAPI specificati
</div></div>
<div class="tilted-section"><div markdown="1">

## Responses parsed from Postman collection examples

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.

# 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

0 comments on commit aa61018

Please sign in to comment.