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
***markdown**: Generates an index file and example files in Markdown.
173
176
***api_blueprint**: Generates an index file and example files in [APIBlueprint](https://apiblueprint.org).
174
177
***append_json**: Lets you selectively run specs without destroying current documentation. See section below.
178
+
***open_api**: Generates [OpenAPI Specification](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md) (OAS) (Current supported version is 2.0). Can be used for [Swagger-UI](https://swagger.io/tools/swagger-ui/)
175
179
176
180
### append_json
177
181
@@ -228,6 +232,173 @@ This [format](https://apiblueprint.org) (APIB) has additional functions:
228
232
229
233
*`attribute`: APIB has attributes besides parameters. Use attributes exactly
230
234
like you'd use `parameter` (see documentation below).
235
+
236
+
### open_api
237
+
238
+
This [format](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md) (OAS) has additional functions:
You could pass `Symbol` as value. In this case you need to define a `let` with the same name.
248
+
249
+
```
250
+
authentication :apiKey, :api_key
251
+
let(:api_key) { some_value }
252
+
```
253
+
254
+
* `route_summary(text)` and `route_description(text)`. ([Operation object](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/2.0.md#operation-object))
255
+
256
+
These two simplest methods accept `String`.
257
+
It will be used for route's `summary` and `description`.
258
+
259
+
* Several new options on `parameter` helper.
260
+
261
+
- `with_example: true`. This option will adjust your description of the parameter with the passed value.
262
+
- `default: <value>`. Will provide a default value for the parameter.
263
+
- `minimum: <integer>`. Will setup upper limit for your parameter.
264
+
- `maximum: <integer>`. Will setup lower limit for your parameter.
265
+
- `enum: [<value>, <value>, ..]`. Will provide a pre-defined list of possible values for your parameter.
266
+
- `type: [:file, :array, :object, :boolean, :integer, :number, :string]`. Will set a type for the parameter. Most of the type you don't need to provide this option manually. We extract types from values automatically.
267
+
268
+
269
+
You also can provide a configuration file in YAML or JSON format with some manual configs.
270
+
The file should be placed in `configurations_dir` folder with the name `open_api.yml` or `open_api.json`.
271
+
In this file you able to manually **hide** some endpoints/resources you want to hide from generated API specification but still want to test.
272
+
It's also possible to pass almost everything to the specification builder manually.
0 commit comments