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

Commit 83ae5bd

Browse files
committed
docs: update folder features
1 parent 4513095 commit 83ae5bd

1 file changed

Lines changed: 60 additions & 2 deletions

File tree

docs/index.md

Lines changed: 60 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
## Features at a glance
1717

18-
- Postman Collection v2.1 and v2.0
18+
- Postman Collection v2.1 and v2.0.
1919
- OpenApi 3.0
2020
- Basic info API from Postman info or customizable.
2121
- Basic method conversion (GET, POST, PUT...).
@@ -205,6 +205,62 @@ The info about the API external documentation, as described in OpenAPI spec [Ext
205205

206206
This info can be provided as collection variables in the same way as described in section [License and Contact configuration](#license-and-contact-configuration), you can setup the variables `externalDocs.url` and `externalDocs.description` for provide the information.
207207

208+
### folders (Object)
209+
210+
This library support the use of folders and nested folders as OpenAPI `tags`, see [Folders as tags](#folders-as-tags) section for more info, with this options you can configure the behavior of the tags calculation when there exist multiple level of folders in the Postman collection, the fields inside `folders` object are:
211+
212+
| Param | Description |
213+
|------------------|--------------------------------|
214+
| `concat` | Boolean. Indicated if in case of multiple levels of folders the tag used in the request is a concatenation of the folders name. Default value `true`. |
215+
| `separator` | String. Separator used to concatenate the names of the different folders. Default value ` > ` |
216+
217+
If we have a Postman collection with an structure as:
218+
219+
```txt
220+
|- Domestic Payments (folder)
221+
|- Consent (folder)
222+
|- request 1
223+
|- request 2
224+
|- Scheduled payments (folder)
225+
|- Consent (folder)
226+
|- request 3
227+
|- request 4
228+
```
229+
230+
The tags for each request would be:
231+
232+
| Request | Default config | Custom separator | Avoid concatenation |
233+
|-----------|--------------------------------|------------------------------|----------------------|
234+
| request 1 | `Domestic Payments > Consent` | `Domestic Payments-Consent` | `Consent` |
235+
| request 2 | `Domestic Payments` | `Domestic Payments` | `Domestic Payments` |
236+
| request 3 | `Scheduled payments > Consent` | `Scheduled payments-Consent` | `Consent` |
237+
| request 4 | `Scheduled payments` | `Scheduled payments` | `Scheduled payments` |
238+
239+
Default config:
240+
241+
```js
242+
{
243+
concat = true,
244+
separator = ' > '
245+
}
246+
```
247+
248+
Custom separator:
249+
250+
```js
251+
{
252+
separator = '-'
253+
}
254+
```
255+
256+
Avoid concatenation
257+
258+
```js
259+
{
260+
concat = false
261+
}
262+
```
263+
208264
</div></div>
209265
<div class="tilted-section"><div markdown="1">
210266

@@ -230,7 +286,9 @@ Have a look to the [SimplePost collection](https://github.com/joolfe/postman-to-
230286

231287
## Folders as tags
232288

233-
In postman you can add [folders](https://learning.postman.com/docs/sending-requests/intro-to-collections/) inside your collection to group requests and keep the collection clean, in OpenAPI there are no folders but exist the concept of [tags](http://spec.openapis.org/oas/v3.0.3.html#tag-object) that has the same approximate meaning, this library automatically detect folders and use the name of the folder as tag name in the transformation. Right now is not possible to have more than one tag value for each operation.
289+
In postman you can add [folders](https://learning.postman.com/docs/sending-requests/intro-to-collections/) inside your collection to group requests and keep the collection clean, in OpenAPI there are no folders but exist the concept of [tags](http://spec.openapis.org/oas/v3.0.3.html#tag-object) that has the same approximate meaning, this library automatically detect folders and use the name of the folder as tag name in the transformation.
290+
291+
If you have more than one level of folders you can configure the behavior to calculate the tag of the request, See option [folders](#folders-object) for more info about how to configure this feature and some examples.
234292

235293
As part of the implementation we now support `description` for [tags](http://spec.openapis.org/oas/v3.0.3.html#tag-object), just add a description into the Postman Collection folder and automatically the `tags` section will be filled in the he OpenApi spec.
236294

0 commit comments

Comments
 (0)