You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 27, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: docs/index.md
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -131,6 +131,25 @@ The global authorization info can be parse from the Postman collection as descri
131
131
}
132
132
```
133
133
134
+
### servers (Array)
135
+
136
+
The global servers list can be parse from the Postman collection as described in [Global servers configuration](#global-servers-configuration) section, but you can customize this info using the `servers` option, this param is an array of objects that follow the structure of OpenAPI [Server Objects](https://swagger.io/specification/#server-object), only `url` and `description` field are supported in this moment, as an example of how to use this option:
137
+
138
+
```js
139
+
{
140
+
servers: [
141
+
{
142
+
url:'https://awesome.api.sandbox.io',
143
+
description:'Sandbox environment server'
144
+
},
145
+
{
146
+
url:'https://awesome.api.io',
147
+
description:'Production environment server'
148
+
}
149
+
]
150
+
}
151
+
```
152
+
134
153
</div></div>
135
154
<divclass="tilted-section"><divmarkdown="1">
136
155
@@ -178,6 +197,18 @@ You can customize the global authorization definition using the [Auth option](#a
178
197
179
198
Have a look to the collections [AuthBasic](https://github.com/joolfe/postman-to-openapi/blob/master/test/resources/input/AuthBasic.json) and [AuthBearer](https://github.com/joolfe/postman-to-openapi/blob/master/test/resources/input/AuthBearer.json) for examples of how to use this feature.
180
199
200
+
## Global servers configuration
201
+
202
+
The OpenAPI root [servers](https://swagger.io/specification/#openapi-object) definition is filled parsing the urls used in the Postman collections requests, the library use all the different urls for create an array of server (removing duplicated), but normally this is not to usefully as Postman collection only will have one environment url, for this reason you can customize the global servers definition using the [server option](#servers-(array))
203
+
204
+
If you don't want to include a `servers` array in your OpenAPI spec file you just need to pass an empty array as server option, as for example:
0 commit comments