Skip to content

Commit 42da4a4

Browse files
authored
Merge branch 'OpenAPI.next' into earth2marsh-patch-1
2 parents ae7045b + 20452d6 commit 42da4a4

File tree

1 file changed

+79
-76
lines changed

1 file changed

+79
-76
lines changed

versions/3.0.md

Lines changed: 79 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The OpenAPI Specification (OAS) is a project used to describe and document RESTf
1212

1313

1414
The OpenAPI Specification defines a set of files required to describe such an API.
15-
These files can then be used by the Swagger-UI project to display the API and Swagger-Codegen to generate clients in various programming languages.
15+
These files can then be used by documentation generation tools to display the API and code generation tools to generate clients in various programming languages.
1616

1717
Additional utilities can also take advantage of the resulting files, such as testing tools.
1818

@@ -33,39 +33,39 @@ Additional utilities can also take advantage of the resulting files, such as tes
3333
- [Info Object](#infoObject)
3434
- [Contact Object](#contactObject)
3535
- [License Object](#licenseObject)
36-
- [Server Object](#server-object)
37-
- [Components Object](#components-object)
38-
- [Paths Object](#paths-object)
39-
- [Path Item Object](#path-item-object)
40-
- [Operation Object](#operation-object)
41-
- [External Documentation Object](#external-documentation-object)
42-
- [Parameter Object](#parameter-object)
43-
- [Request Body Object](#request-body-object)
44-
- [Content Object](#content-object)
45-
- [Content Type Object](#content-type-object)
46-
- [Responses Object](#responses-object)
47-
- [Response Object](#response-object)
48-
- [Headers Object](#headers-object)
49-
- [Examples Object](#examples-object)
50-
- [Links Object](#links-object)
51-
- [Link Object](#link-object)
52-
- [Variable substitution](#variable-substitution)
53-
- [Link Parameters](#link-parameters)
54-
- [Header Object](#header-object)
55-
- [Tag Object](#tag-object)
56-
- [Examples Object](#examples-object)
57-
- [Reference Object](#reference-object)
58-
- [Schema Object](#schema-object)
59-
- [XML Object](#xml-object)
60-
- [Definitions Object](#definitions-object)
61-
- [Parameters Definitions Object](#parameters-definitions-object)
62-
- [Responses Definitions Object](#responses-definitions-object)
63-
- [Security Definitions Object](#security-definitions-object)
64-
- [Security Scheme Object](#security-scheme-object)
65-
- [Scopes Object](#scopes-object)
66-
- [Security Requirement Object](#security-requirement-object)
67-
- [Specification Extensions](#specification-extensions)
68-
- [Security Filtering](#security-filtering)
36+
- [Server Object](#serverObject)
37+
- [Components Object](#componentsObject)
38+
- [Paths Object](#pathsObject)
39+
- [Path Item Object](#pathItemObject)
40+
- [Operation Object](#operationObject)
41+
- [External Documentation Object](#externalDocumentationObject)
42+
- [Parameter Object](#parameterObject)
43+
- [Request Body Object](#requestBodyObject)
44+
- [Content Object](#contentObject)
45+
- [Content Type Object](#contentTypeObject)
46+
- [Responses Object](#responsesObject)
47+
- [Response Object](#responseObject)
48+
- [Headers Object](#headersObject)
49+
- [Examples Object](#examplesObject)
50+
- [Links Object](#linksObject)
51+
- [Link Object](#linkObject)
52+
- [Variable substitution](#variableSubstitution)
53+
- [Link Parameters](#linkParameters)
54+
- [Header Object](#headerObject)
55+
- [Tag Object](#tagObject)
56+
- [Examples Object](#examplesObject)
57+
- [Reference Object](#referenceObject)
58+
- [Schema Object](#schemaObject)
59+
- [XML Object](#xmlObject)
60+
- [Definitions Object](#definitionsObject)
61+
- [Parameters Definitions Object](#parametersDefinitionsObject)
62+
- [Responses Definitions Object](#responsesDefinitionsObject)
63+
- [Security Definitions Object](#securityDefinitionsObject)
64+
- [Security Scheme Object](#securitySchemeObject)
65+
- [Scopes Object](#scopesObject)
66+
- [Security Requirement Object](#securityRequirementObject)
67+
- [Specification Extensions](#specificationExtensions)
68+
- [Security Filtering](#securityFiltering)
6969
- [Appendix A: Revision History](#revisionHistory)
7070

7171

@@ -94,7 +94,8 @@ Some examples of possible media type definitions:
9494
application/vnd.github.v3.patch
9595
```
9696
##### <a name="httpCodes"></a>HTTP Status Codes
97-
The HTTP Status Codes are used to indicate the status of the executed operation. The available status codes are initially defined by [RFC 7231](http://tools.ietf.org/html/rfc7231#section-6) and registered status codes are listed in the [IANA Status Code Registry](http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml).
97+
The HTTP Status Codes are used to indicate the status of the executed operation.
98+
The available status codes are defined by [RFC 7231](http://tools.ietf.org/html/rfc7231#section-6) and registered status codes are listed in the [IANA Status Code Registry](http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml).
9899

99100
## Specification
100101

@@ -134,10 +135,12 @@ By convention, it is RECOMMENDED that the OpenAPI Specification (OAS) file be na
134135

135136
### <a name="dataTypes"></a>Data Types
136137

137-
Primitive data types in the OAS are based on the types supported by the [JSON Schema Specification Wright Draft 00](https://tools.ietf.org/html/draft-wright-json-schema-00#section-4.2). Note that `integer` as a type is also supported and is defined as a JSON number without a fraction or exponent part. `null` is not supported as a value.
138+
Primitive data types in the OAS are based on the types supported by the [JSON Schema Specification Wright Draft 00](https://tools.ietf.org/html/draft-wright-json-schema-00#section-4.2).
139+
Note that `integer` as a type is also supported and is defined as a JSON number without a fraction or exponent part.
140+
`null` is not supported as a value.
138141
Models are described using the [Schema Object](#schemaObject) which is an extended subset of JSON Schema Specification Wright Draft 00.
139142

140-
<a name="dataTypeFormat"></a>Primitives have an optional modifier property `format`.
143+
<a name="dataTypeFormat"></a>Primitives have an optional modifier property: `format`.
141144
OAS uses several known formats to more finely define the data type being used.
142145
However, the `format` property is an open `string`-valued property, and can have any value to support documentation needs.
143146
Formats such as `"email"`, `"uuid"`, etc., can be used even though they are not defined by this specification.
@@ -203,7 +206,7 @@ In subsequent versions of the OpenAPI Specification, care will be given such tha
203206
#### <a name="infoObject"></a>Info Object
204207

205208
The object provides metadata about the API.
206-
The metadata can be used by the clients if needed, and can be presented in the Swagger-UI for convenience.
209+
The metadata can be used by the clients if needed, and can be presented in editing or documentation generation tools for convenience.
207210

208211
##### Fixed Fields
209212

@@ -214,21 +217,22 @@ Field Name | Type | Description
214217
<a name="infoTermsOfService"></a>termsOfService | `string` | A URL to the Terms of Service for the API.
215218
<a name="infoContact"></a>contact | [Contact Object](#contactObject) | The contact information for the exposed API.
216219
<a name="infoLicense"></a>license | [License Object](#licenseObject) | The license information for the exposed API.
217-
<a name="infoVersion"></a>version | `string` | **Required.** Provides the version of the application API (not to be confused with the specification version). While not required, is it suggested that the `info.version` value correspond to the version of the API definition. In practice, the version of the API _implementation_ MAY evolve at an entirely different rate.
220+
<a name="infoVersion"></a>version | `string` | **Required.** The version of the API definition (which is distinct from the OpenAPI specification version or the API implementation version).
221+
218222

219223
This object can be extended with [Specification Extensions](#specificationExtensions).
220224

221225
##### Info Object Example:
222226

223227
```json
224228
{
225-
"title": "Swagger Sample App",
229+
"title": "Sample Pet Store App",
226230
"description": "This is a sample server for a pet store.",
227-
"termsOfService": "http://swagger.io/terms/",
231+
"termsOfService": "http://example.com/terms/",
228232
"contact": {
229233
"name": "API Support",
230-
"url": "http://www.swagger.io/support",
231-
"email": "support@swagger.io"
234+
"url": "http://www.example.com/support",
235+
"email": "support@example.com"
232236
},
233237
"license": {
234238
"name": "Apache 2.0",
@@ -239,13 +243,13 @@ This object can be extended with [Specification Extensions](#specificationExtens
239243
```
240244

241245
```yaml
242-
title: Swagger Sample App
246+
title: Sample Pet Store App
243247
description: This is a sample server for a pet store.
244-
termsOfService: http://swagger.io/terms/
248+
termsOfService: http://example.com/terms/
245249
contact:
246250
name: API Support
247-
url: http://www.swagger.io/support
248-
email: support@swagger.io
251+
url: http://www.example.com/support
252+
email: support@example.com
249253
license:
250254
name: Apache 2.0
251255
url: http://www.apache.org/licenses/LICENSE-2.0.html
@@ -271,15 +275,15 @@ This object can be extended with [Specification Extensions](#specificationExtens
271275
```json
272276
{
273277
"name": "API Support",
274-
"url": "http://www.swagger.io/support",
275-
"email": "support@swagger.io"
278+
"url": "http://www.example.com/support",
279+
"email": "support@example.com"
276280
}
277281
```
278282

279283
```yaml
280284
name: API Support
281-
url: http://www.swagger.io/support
282-
email: support@swagger.io
285+
url: http://www.example.com/support
286+
email: support@example.com
283287
```
284288

285289
#### <a name="licenseObject"></a>License Object
@@ -575,7 +579,7 @@ Describes a single API operation on a path.
575579
Field Name | Type | Description
576580
---|:---:|---
577581
<a name="operationTags"></a>tags | [`string`] | A list of tags for API documentation control. Tags can be used for logical grouping of operations by resources or any other qualifier.
578-
<a name="operationSummary"></a>summary | `string` | A short summary of what the operation does. For maximum readability in the swagger-ui, this field SHOULD be less than 120 characters.
582+
<a name="operationSummary"></a>summary | `string` | A short summary of what the operation does. For maximum readability in editing or documentation generation tools, this field SHOULD be less than 120 characters.
579583
<a name="operationDescription"></a>description | `string` | A verbose explanation of the operation behavior. [CommonMark syntax](http://spec.commonmark.org/) can be used for rich text representation.
580584
<a name="operationExternalDocs"></a>externalDocs | [External Documentation Object](#externalDocumentationObject) | Additional external documentation for this operation.
581585
<a name="operationId"></a>operationId | `string` | Unique string used to identify the operation. The id MUST be unique among all operations described in the API. Tools and libraries MAY use the operationId to uniquely identify an operation, therefore, it is recommended to follow common programming naming conventions.
@@ -597,7 +601,6 @@ This object can be extended with [Specification Extensions](#specificationExtens
597601
"pet"
598602
],
599603
"summary": "Updates a pet in the store with form data",
600-
"description": "",
601604
"operationId": "updatePetWithForm",
602605
"parameters": [
603606
{
@@ -659,7 +662,6 @@ This object can be extended with [Specification Extensions](#specificationExtens
659662
tags:
660663
- pet
661664
summary: Updates a pet in the store with form data
662-
description: ''
663665
operationId: updatePetWithForm
664666
parameters:
665667
- name: petId
@@ -716,13 +718,13 @@ This object can be extended with [Specification Extensions](#specificationExtens
716718
```json
717719
{
718720
"description": "Find more info here",
719-
"url": "https://swagger.io"
721+
"url": "https://example.com"
720722
}
721723
```
722724

723725
```yaml
724726
description: Find more info here
725-
url: https://swagger.io
727+
url: https://example.com
726728
```
727729

728730
#### <a name="parameterObject"></a>Parameter Object
@@ -1088,6 +1090,7 @@ Field Name | Type | Description
10881090
<a name="contentTypeSchema"></a>schema | [Schema Object](#schemaObject) | The schema defining the type used for the request body.
10891091
<a name="contentTypeExamples"></a>examples | [Examples Array](#examplesArray) | Examples of the content type. Each example in the Examples array SHOULD be in the correct format as specified in the _content_ type. The `examples` object is mutually exclusive to the `example` object. Furthermore, if referencing a `schema` which contains an example, the `examples` value SHALL _override_ the example provided by the schema.
10901092
<a name="contentTypeExample"></a>example | [Example Object](#exampleObject) | Example of the content type. The example object SHOULD be in the correct format as specified in the _content_ type. The `example` object is mutually exclusive to the `examples` object. Furthermore, if referencing a `schema` which contains an example, the `example` value SHALL _override_ the the example provided by the schema.
1093+
<a name="contentTypeEncoding"></a>encoding | [Encoding Object](#encodingObject) | Encoding of the content type. The encoding object SHOULD only apply to `requestBody` objects when the content type is `multipart`.
10911094

10921095
##### Patterned Fields
10931096
Field Pattern | Type | Description
@@ -1291,13 +1294,13 @@ requestBody:
12911294
# default is application/octet-stream, need to declare an image type only!
12921295
type: string
12931296
format: binary
1294-
encoding:
1295-
historyMetadata:
1296-
# require XML content-type in utf-8 encoding
1297-
contentType: application/xml; charset=utf-8
1298-
profileImage:
1299-
# only accept png/jpeg
1300-
contentType: image/png, image/jpeg
1297+
encoding:
1298+
historyMetadata:
1299+
# require XML content-type in utf-8 encoding
1300+
contentType: application/xml; charset=utf-8
1301+
profileImage:
1302+
# only accept png/jpeg
1303+
contentType: image/png, image/jpeg
13011304
```
13021305

13031306
#### <a name="responsesObject"></a>Responses Object
@@ -2824,7 +2827,7 @@ In this example, a full model definition is shown.
28242827
"name": {
28252828
"type": "string",
28262829
"xml": {
2827-
"namespace": "http://swagger.io/schema/sample",
2830+
"namespace": "http://example.com/schema/sample",
28282831
"prefix": "sample"
28292832
}
28302833
}
@@ -2845,13 +2848,13 @@ Person:
28452848
name:
28462849
type: string
28472850
xml:
2848-
namespace: http://swagger.io/schema/sample
2851+
namespace: http://example.com/schema/sample
28492852
prefix: sample
28502853
```
28512854

28522855
```xml
28532856
<Person id="123">
2854-
<sample:name xmlns:sample="http://swagger.io/schema/sample">example</sample:name>
2857+
<sample:name xmlns:sample="http://example.com/schema/sample">example</sample:name>
28552858
</Person>
28562859
```
28572860

@@ -3256,7 +3259,7 @@ Field Pattern | Type | Description
32563259
"type": "oauth2",
32573260
"flow": {
32583261
"implicit": {
3259-
"authorizationUrl": "http://swagger.io/api/oauth/dialog",
3262+
"authorizationUrl": "http://example.com/api/oauth/dialog",
32603263
"scopes": {
32613264
"write:pets": "modify pets in your account",
32623265
"read:pets": "read your pets"
@@ -3276,7 +3279,7 @@ petstore_auth:
32763279
type: oauth2
32773280
flow:
32783281
implicit:
3279-
authorizationUrl: http://swagger.io/api/oauth/dialog
3282+
authorizationUrl: http://example.com/api/oauth/dialog
32803283
scopes:
32813284
write:pets: modify pets in your account
32823285
read:pets: read your pets
@@ -3356,7 +3359,7 @@ bearerFormat: JWT
33563359
"type": "oauth2",
33573360
"flow": {
33583361
"implicit": {
3359-
"authorizationUrl": "https://swagger.io/api/oauth/dialog",
3362+
"authorizationUrl": "https://example.com/api/oauth/dialog",
33603363
"scopes": {
33613364
"write:pets": "modify pets in your account",
33623365
"read:pets": "read your pets"
@@ -3370,7 +3373,7 @@ bearerFormat: JWT
33703373
type: oauth2
33713374
flow:
33723375
implicit:
3373-
authorizationUrl: https://swagger.io/api/oauth/dialog
3376+
authorizationUrl: https://example.com/api/oauth/dialog
33743377
scopes:
33753378
write:pets: modify pets in your account
33763379
read:pets: read your pets
@@ -3411,15 +3414,15 @@ This object can be extended with [Specification Extensions](#specificationExtens
34113414
"type": "oauth2",
34123415
"flow": {
34133416
"implicit": {
3414-
"authorizationUrl": "https://swagger.io/api/oauth/dialog",
3417+
"authorizationUrl": "https://example.com/api/oauth/dialog",
34153418
"scopes": {
34163419
"write:pets": "modify pets in your account",
34173420
"read:pets": "read your pets"
34183421
}
34193422
},
34203423
"authorizationCode": {
3421-
"authorizationUrl": "https://swagger.io/api/oauth/dialog",
3422-
"tokenUrl": "https://swagger.io/api/oauth/token",
3424+
"authorizationUrl": "https://example.com/api/oauth/dialog",
3425+
"tokenUrl": "https://example.com/api/oauth/token",
34233426
"scopes": {
34243427
"write:pets": "modify pets in your account",
34253428
"read:pets": "read your pets"
@@ -3433,13 +3436,13 @@ This object can be extended with [Specification Extensions](#specificationExtens
34333436
type: oauth2
34343437
flow:
34353438
implicit:
3436-
authorizationUrl: https://swagger.io/api/oauth/dialog
3439+
authorizationUrl: https://example.com/api/oauth/dialog
34373440
scopes:
34383441
write:pets: modify pets in your account
34393442
read:pets: read your pets
34403443
authorizationCode:
3441-
authorizationUrl: https://swagger.io/api/oauth/dialog
3442-
tokenUrl: https://swagger.io/api/oauth/token
3444+
authorizationUrl: https://example.com/api/oauth/dialog
3445+
tokenUrl: https://example.com/api/oauth/token
34433446
scopes:
34443447
write:pets: modify pets in your account
34453448
read:pets: read your pets

0 commit comments

Comments
 (0)