|
1 |
| -# Swagger Extensions |
| 1 | +# OpenAPI Extensions |
2 | 2 |
|
3 |
| -The Swagger 2.0 specification allows for custom properties to be added at several places within a Swagger definition, allowing |
| 3 | +The OpenAPI Specification version 2.0 allows for custom properties to be added at several places within an OpenAPI definition, allowing |
4 | 4 | API providers to extend the meta-data provided for their REST APIs as needed. Extension properties are always
|
5 | 5 | prefixed by "x-" and can have any valid JSON format value.
|
6 | 6 |
|
7 | 7 | Currently extension properties are supported in the following definition objects:
|
8 | 8 |
|
9 |
| -* within the [info object](https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#info-object) |
10 |
| -* within the [paths object](https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#paths-object) |
11 |
| -* within the [path-item object](https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#path-item-object) |
12 |
| -* within the [operation object](https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#operationObject) |
13 |
| -* within the [parameter object](https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#parameterObject) |
14 |
| -* within the [responses object](https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#responses-object) |
15 |
| -* within the [tag object](https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#tag-object) |
16 |
| -* within the [security-scheme object](https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#security-scheme-object) |
| 9 | +* within the [info object](https://github.com/OAI/OpenAPI-Specification/blob/OpenAPI.next/versions/2.0.md#info-object) |
| 10 | +* within the [paths object](https://github.com/OAI/OpenAPI-Specification/blob/OpenAPI.next/versions/2.0.md#paths-object) |
| 11 | +* within the [path-item object](https://github.com/OAI/OpenAPI-Specification/blob/OpenAPI.next/versions/2.0.md#path-item-object) |
| 12 | +* within the [operation object](https://github.com/OAI/OpenAPI-Specification/blob/OpenAPI.next/versions/2.0.md#operationObject) |
| 13 | +* within the [parameter object](https://github.com/OAI/OpenAPI-Specification/blob/OpenAPI.next/versions/2.0.md#parameterObject) |
| 14 | +* within the [responses object](https://github.com/OAI/OpenAPI-Specification/blob/OpenAPI.next/versions/2.0.md#responses-object) |
| 15 | +* within the [tag object](https://github.com/OAI/OpenAPI-Specification/blob/OpenAPI.next/versions/2.0.md#tag-object) |
| 16 | +* within the [security-scheme object](https://github.com/OAI/OpenAPI-Specification/blob/OpenAPI.next/versions/2.0.md#security-scheme-object) |
17 | 17 |
|
18 |
| -For example, a vendor extension that adds apis.json specific metadata a Swagger definition might look as follows: |
| 18 | +For example, a vendor extension that adds apis.json specific metadata to an OpenAPI definition might look as follows: |
19 | 19 |
|
20 | 20 | ```json
|
21 | 21 | {
|
@@ -59,8 +59,8 @@ For example, a vendor extension that adds apis.json specific metadata a Swagger
|
59 | 59 | }
|
60 | 60 | ```
|
61 | 61 |
|
62 |
| -This could be used by corresponding tooling that builds apis.json files for swagger definitions, the advantage being that all metadata |
63 |
| -for a Swagger API is within one definition instead of spread out amongst multiple files. |
| 62 | +This could be used by corresponding tooling that builds apis.json files for OpenAPI definitions, the advantage being that all metadata |
| 63 | +for the API is within one definition instead of spread out amongst multiple files. |
64 | 64 |
|
65 | 65 | Another (simplified) example could be how to specify a [JWE encryption](http://hdknr.github.io/docs/identity/jwe.html) policy to parameters,
|
66 | 66 | for example as follows:
|
@@ -89,4 +89,4 @@ An API consumer reading these parameter definitions could interpret this as havi
|
89 | 89 |
|
90 | 90 | ## Annotations
|
91 | 91 |
|
92 |
| -The Swagger-specific annotations currently available for jax-rs APIs do not support the addition of extension data. |
| 92 | +The OpenAPI-specific annotations currently available for jax-rs APIs do not support the addition of extension data. |
0 commit comments