Skip to content

Commit 9dc099c

Browse files
author
Ron
authored
Merge branch 'OpenAPI.next' into requireed-fields
2 parents 8beb3a7 + 54f6134 commit 9dc099c

File tree

1 file changed

+26
-29
lines changed

1 file changed

+26
-29
lines changed

versions/3.0.md

Lines changed: 26 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ By convention, it is RECOMMENDED that the OpenAPI Specification (OAS) file be na
139139

140140
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).
141141
Note that `integer` as a type is also supported and is defined as a JSON number without a fraction or exponent part.
142-
`null` is not supported as a value.
142+
`null` is not supported as a type (see [`nullable`](#schemaNullable) for an alternative solution).
143143
Models are described using the [Schema Object](#schemaObject) which is an extended subset of JSON Schema Specification Wright Draft 00.
144144

145145
<a name="dataTypeFormat"></a>Primitives have an optional modifier property: `format`.
@@ -338,7 +338,7 @@ url: https://development.gigantic-server.com/v1
338338
description: Development server
339339
```
340340

341-
The following shows how multiple servers can be described, for example, at the OpenAPI Object's `servers`(#oasServers):
341+
The following shows how multiple servers can be described, for example, at the OpenAPI Object's [`servers`](#oasServers):
342342

343343
```yaml
344344
servers:
@@ -508,7 +508,7 @@ my\org\User
508508
},
509509
"petstore_auth": {
510510
"type": "oauth2",
511-
"flow": {
511+
"flows": {
512512
"implicit": {
513513
"authorizationUrl": "http://example.org/api/oauth/dialog",
514514
"scopes": {
@@ -576,7 +576,7 @@ components:
576576
in: header
577577
petstore_auth:
578578
type: oauth2
579-
flow:
579+
flows:
580580
implicit:
581581
authorizationUrl: http://example.org/api/oauth/dialog
582582
scopes:
@@ -661,7 +661,7 @@ Field Name | Type | Description
661661
<a name="pathItemHead"></a>head | [Operation Object](#operationObject) | A definition of a HEAD operation on this path.
662662
<a name="pathItemPatch"></a>patch | [Operation Object](#operationObject) | A definition of a PATCH operation on this path.
663663
<a name="pathItemTrace"></a>trace | [Operation Object](#operationObject) | A definition of a TRACE operation on this path.
664-
<a name="pathItemServers"></a>servers | [Server Object](#serverObject) | An alternative `server` array to service all operations in this path.
664+
<a name="pathItemServers"></a>servers | [[Server Object](#serverObject)] | An alternative `server` array to service all operations in this path.
665665
<a name="pathItemParameters"></a>parameters | [[Parameter Object](#parameterObject) \| [Reference Object](#referenceObject)] | A list of parameters that are applicable for all the operations described under this path. These parameters can be overridden at the operation level, but cannot be removed there. The list MUST NOT include duplicated parameters. A unique parameter is defined by a combination of a [name](#parameterName) and [___location](#parameterIn). The list can use the [Reference Object](#referenceObject) to link to parameters that are defined at the [OpenAPI Object's parameters](#oasParameters).
666666

667667

@@ -767,7 +767,7 @@ Field Name | Type | Description
767767
<a name="operationCallbacks"></a>callbacks | [Callbacks Object](#callbacksObject) | The list of possible callbacks as they are returned from executing this operation.
768768
<a name="operationDeprecated"></a>deprecated | `boolean` | Declares this operation to be deprecated. Consumers SHOULD refrain from usage of the declared operation. Default value is `false`.
769769
<a name="operationSecurity"></a>security | [[Security Requirement Object](#securityRequirementObject)] | A declaration of which security mechanisms can be used for this operation. The list of values includes alternative security requirement objects that can be used. Only one of the security requirement objects need to be satisfied to authorize a request. This definition overrides any declared top-level [`security`](#oasSecurity). To remove a top-level security declaration, an empty array can be used.
770-
<a name="operationServers"></a>servers | [Server Object](#serverObject) | An alternative `server` array to service this operation. If an alternative `server` object is specified at the Path Item Object or Root level, it will be overridden by this value.
770+
<a name="operationServers"></a>servers | [[Server Object](#serverObject)] | An alternative `server` array to service this operation. If an alternative `server` object is specified at the Path Item Object or Root level, it will be overridden by this value.
771771

772772
This object can be extended with [Specification Extensions](#specificationExtensions).
773773

@@ -1111,7 +1111,7 @@ Field Name | Type | Description
11111111
---|:---:|---
11121112
<a name="requestBodyDescription"></a>description | `string` | A brief description of the request body. This could contain examples of use. [CommonMark syntax](http://spec.commonmark.org/) can be used for rich text representation.
11131113
<a name="requestBodyContent"></a>content | [Content Object](#contentObject) | **Required.** The content of the request body.
1114-
<a name="requestBodyRequired"></a>required | `boolean` | Determines if the request body is required in the request. Defaults to `true`.
1114+
<a name="requestBodyRequired"></a>required | `boolean` | Determines if the request body is required in the request. Defaults to `false`.
11151115

11161116

11171117
This object can be extended with [Specification Extensions](#specificationExtensions).
@@ -1466,7 +1466,7 @@ When passing complex objects in the `x-www-form-urlencoded` content type, the de
14661466

14671467
It is common to use `multipart/form-data` as a `Content-Type` when transferring request bodies to operations. In contrast to 2.0, a `schema` is required to define the input parameters to the operation when using `multipart` content. This allows complex structures as well as supports mechanisms for multiple file uploads.
14681468

1469-
When passing in `multipart` types, boundaries MAY be used to separate sections of the content being transferred--thus, the following default `Content-Type`s are defined for `multipart/*`:
1469+
When passing in `multipart` types, boundaries MAY be used to separate sections of the content being transferredthus, the following default `Content-Type`s are defined for `multipart/*`:
14701470

14711471
* If the property is a primitive, or an array of primitive values, the default Content-Type is `text/plain`
14721472
* If the property is complex, or an array of complex values, the default Content-Type is `application/json`
@@ -1560,7 +1560,7 @@ Field Name | Type | Description
15601560
---|:---:|---
15611561
<a name="encodingContentType"></a>contentType | `string` | The Content-Type to use for encoding a specific property. Default value depends on the property type: for `string` with `format` being `binary` – `application/octet-stream`; for other primitive types – `text/plain`; for `object` - `application/json`; for `array` – the default is defined based on the inner type.
15621562
<a name="encodingHeaders"></a>headers | `object` | A string map allowing additional information to be provided as headers, for example `Content-Disposition`. Note `Content-Type` is described separately and will be ignored from this section.
1563-
<a name="encodingStyle"></a>style | `string` | The Content-Type to use for encoding a specific property. See [Parameter Object](#parameterObject) for details on the [`style`](#parameterStyle) property. The behavior follows the same values allowed for `query` parameters, including default values.
1563+
<a name="encodingStyle"></a>style | `string` | Describes how a specific property value will be serialized depending on its type . See [Parameter Object](#parameterObject) for details on the [`style`](#parameterStyle) property. The behavior follows the same values allowed for `query` parameters, including default values.
15641564
<a name="encodingExplode"></a>explode | `boolean` | When this is true, property values of type `array` or `object` generate separate parameters for each value of the array, or key-value-pair of the map. For other types of properties this property has no effect. When [`style`](#encodingStyle) is `form`, the default value is `true`. For all other styles, the default value is `false`.
15651565

15661566
This object can be extended with [Specification Extensions](#specificationExtensions).
@@ -1582,14 +1582,12 @@ SHOULD be the response for a successful operation call.
15821582
##### Fixed Fields
15831583
Field Name | Type | Description
15841584
---|:---:|---
1585-
<a name="responsesDefault"></a>default | [Response Object](#responseObject) \| [Reference Object](#referenceObject) | The documentation of responses other than the ones declared for specific HTTP response codes.
1586-
It can be used to cover undeclared responses.
1587-
[Reference Object](#referenceObject) can be used to link to a response that is defined at the [OpenAPI Object's responses](#oasResponses) section.
1585+
<a name="responsesDefault"></a>default | [Response Object](#responseObject) \| [Reference Object](#referenceObject) | The documentation of responses other than the ones declared for specific HTTP response codes. It can be used to cover undeclared responses. [Reference Object](#referenceObject) can be used to link to a response that is defined at the [OpenAPI Object's responses](#oasResponses) section.
15881586

15891587
##### Patterned Fields
15901588
Field Pattern | Type | Description
15911589
---|:---:|---
1592-
<a name="responsesCode"></a>[HTTP Status Code](#httpCodes) | [Response Object](#responseObject) \| [Reference Object](#referenceObject) | Any [HTTP status code](#httpCodes) can be used as the property name (one property per HTTP status code). Describes the expected response for that HTTP status code. [Reference Object](#referenceObject) can be used to link to a response that is defined at the [OpenAPI Object's responses](#oasResponses) section. This field MUST be quoted for compatibility between JSON and YAML (i.e. "200"), and MAY contain the uppercase character, `X` to designate a wildcard, such as `2XX` to represent all response codes between `[200-299]`.
1590+
<a name="responsesCode"></a>[HTTP Status Code](#httpCodes) | [Response Object](#responseObject) \| [Reference Object](#referenceObject) | Any [HTTP status code](#httpCodes) can be used as the property name (one property per HTTP status code). Describes the expected response for that HTTP status code. [Reference Object](#referenceObject) can be used to link to a response that is defined at the [OpenAPI Object's responses](#oasResponses) section. This field MUST be quoted for compatibility between JSON and YAML (i.e. '200'), and MAY contain the uppercase character, `X` to designate a wildcard, such as `2XX` to represent all response codes between `[200-299]`. If a response range is defined, and an explicit code within that range is defined as well, the explicit code definition takes precedence over the range definition for that code.
15931591

15941592

15951593
This object can be extended with [Specification Extensions](#specificationExtensions).
@@ -1995,8 +1993,7 @@ For computing links, and providing instructions to execute them, [variable subst
19951993
##### Patterned Fields
19961994
Field Pattern | Type | Description
19971995
---|:---:|---
1998-
<a name="linkName"></a> {name} | [Link Object](#linkObject) \| [Reference Object](#referenceObject) | A short name for the link, following the naming constraints of the names for [Component Objects](#componentsObject).
1999-
The link SHALL reference a single Link Object, or a JSON Reference to a single link object.
1996+
<a name="linkName"></a> {name} | [Link Object](#linkObject) \| [Reference Object](#referenceObject) | A short name for the link, following the naming constraints of the names for [Component Objects](#componentsObject). The link SHALL reference a single Link Object, or a JSON Reference to a single link object.
20001997

20011998
#### <a name="linkObject"></a>Link Object
20021999
The `Link Object` is responsible for defining a possible operation based on a single response.
@@ -2655,7 +2652,7 @@ Field Name | Type | Description
26552652
<a name="schemaXml"></a>xml | [XML Object](#xmlObject) | This MAY be used only on properties schemas. It has no effect on root schemas. Adds Additional metadata to describe the XML representation format of this property.
26562653
<a name="schemaExternalDocs"></a>externalDocs | [External Documentation Object](#externalDocumentationObject) | Additional external documentation for this schema.
26572654
<a name="schemaExample"></a>example | Any | A free-form property to include an example of an instance for this schema. To represent examples that cannot naturally represented in JSON or YAML, a string value can be used to contain the example with escaping where necessary.
2658-
<a name="schemaDeprecated"></a> deprecated | `boolean` | Specifies that a schema is deprecated and SHOULD be transitioned out of usage.
2655+
<a name="schemaDeprecated"></a> deprecated | `boolean` | Specifies that a schema is deprecated and SHOULD be transitioned out of usage. Default value is `false`.
26592656

26602657
This object can be extended with [Specification Extensions](#specificationExtensions).
26612658

@@ -3365,7 +3362,7 @@ Field Name | Type | Validity | Description
33653362
<a name="securitySchemeIn"></a>in | `string` | `apiKey` | **Required.** The ___location of the API key. Valid values are `"query"` or `"header"`.
33663363
<a name="securitySchemeScheme"></a>scheme | `string` | `http` | **Required.** The name of the HTTP Authorization scheme to be used in the [Authorization header as defined in RFC 7235](https://tools.ietf.org/html/rfc7235#section-4.2).
33673364
<a name="securitySchemeBearerFormat"></a>bearerFormat | `string` | `http` (`"bearer"`) | A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes.
3368-
<a name="securitySchemeFlow"></a>flow | [OAuth Flows Object](#oauthFlowsObject) | `oauth2` | **Required.** An object containing configuration information for the flow types supported.
3365+
<a name="securitySchemeFlows"></a>flows | [OAuth Flows Object](#oauthFlowsObject) | `oauth2` | **Required.** An object containing configuration information for the flow types supported.
33693366
<a name="securitySchemeOpenIdConnectUrl"></a>openIdConnectUrl | `string` | `openIdConnect` | **Required.** OpenId Connect URL to discover OAuth2 configuration values. This MUST be in the form of a URL.
33703367

33713368
This object can be extended with [Specification Extensions](#specificationExtensions).
@@ -3423,7 +3420,7 @@ bearerFormat: JWT
34233420
```json
34243421
{
34253422
"type": "oauth2",
3426-
"flow": {
3423+
"flows": {
34273424
"implicit": {
34283425
"authorizationUrl": "https://example.com/api/oauth/dialog",
34293426
"scopes": {
@@ -3437,7 +3434,7 @@ bearerFormat: JWT
34373434

34383435
```yaml
34393436
type: oauth2
3440-
flow:
3437+
flows:
34413438
implicit:
34423439
authorizationUrl: https://example.com/api/oauth/dialog
34433440
scopes:
@@ -3452,10 +3449,10 @@ Allows configuration of the supported OAuth Flows.
34523449
##### Fixed Fields
34533450
Field Name | Type | Description
34543451
---|:---:|---
3455-
<a name="oauthFlowImplicit"></a>implicit| [OAuth Flow Object](#oauthFlowObject) | Configuration for the OAuth Implicit flow
3456-
<a name="oauthFlowPassword"></a>password| [OAuth Flow Object](#oauthFlowObject) | Configuration for the OAuth Resource Owner Password flow
3457-
<a name="oauthFlowClientCredentials"></a>clientCredentials| [OAuth Flow Object](#oauthFlowObject) | Configuration for the OAuth Client Credentials flow. Previously called `application` in OpenAPI 2.0.
3458-
<a name="oauthFlowAuthorizationCode"></a>authorizationCode| [OAuth Flow Object](#oauthFlowObject) | Configuration for the OAuth Authorization Code flow. Previously called `accessCode` in OpenAPI 2.0.
3452+
<a name="oauthFlowsImplicit"></a>implicit| [OAuth Flow Object](#oauthFlowObject) | Configuration for the OAuth Implicit flow
3453+
<a name="oauthFlowsPassword"></a>password| [OAuth Flow Object](#oauthFlowObject) | Configuration for the OAuth Resource Owner Password flow
3454+
<a name="oauthFlowsClientCredentials"></a>clientCredentials| [OAuth Flow Object](#oauthFlowObject) | Configuration for the OAuth Client Credentials flow. Previously called `application` in OpenAPI 2.0.
3455+
<a name="oauthFlowsAuthorizationCode"></a>authorizationCode| [OAuth Flow Object](#oauthFlowObject) | Configuration for the OAuth Authorization Code flow. Previously called `accessCode` in OpenAPI 2.0.
34593456

34603457
This object can be extended with [Specification Extensions](#specificationExtensions).
34613458

@@ -3466,10 +3463,10 @@ Configuration details for a supported OAuth Flow
34663463
##### Fixed Fields
34673464
Field Name | Type | Validity | Description
34683465
---|:---:|---|---
3469-
<a name="securitySchemeAuthorizationUrl"></a>authorizationUrl | `string` | `oauth2` (`"implicit"`, `"authorizationCode"`) | **Required.** The authorization URL to be used for this flow. This MUST be in the form of a URL.
3470-
<a name="securitySchemeTokenUrl"></a>tokenUrl | `string` | `oauth2` (`"password"`, `"clientCredentials"`, `"authorizationCode"`) | **Required.** The token URL to be used for this flow. This MUST be in the form of a URL.
3471-
<a name="securitySchemeRefreshUrl"></a>refreshUrl | `string` | `oauth2` | The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL.
3472-
<a name="securitySchemeScopes"></a>scopes | [Scopes Object](#scopesObject) | `oauth2` | **Required.** The available scopes for the OAuth2 security scheme.
3466+
<a name="oauthFlowAuthorizationUrl"></a>authorizationUrl | `string` | `oauth2` (`"implicit"`, `"authorizationCode"`) | **Required.** The authorization URL to be used for this flow. This MUST be in the form of a URL.
3467+
<a name="oauthFlowTokenUrl"></a>tokenUrl | `string` | `oauth2` (`"password"`, `"clientCredentials"`, `"authorizationCode"`) | **Required.** The token URL to be used for this flow. This MUST be in the form of a URL.
3468+
<a name="oauthFlowRefreshUrl"></a>refreshUrl | `string` | `oauth2` | The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL.
3469+
<a name="oauthFlowScopes"></a>scopes | [Scopes Object](#scopesObject) | `oauth2` | **Required.** The available scopes for the OAuth2 security scheme.
34733470

34743471
This object can be extended with [Specification Extensions](#specificationExtensions).
34753472

@@ -3478,7 +3475,7 @@ This object can be extended with [Specification Extensions](#specificationExtens
34783475
```JSON
34793476
{
34803477
"type": "oauth2",
3481-
"flow": {
3478+
"flows": {
34823479
"implicit": {
34833480
"authorizationUrl": "https://example.com/api/oauth/dialog",
34843481
"scopes": {
@@ -3500,7 +3497,7 @@ This object can be extended with [Specification Extensions](#specificationExtens
35003497

35013498
```YAML
35023499
type: oauth2
3503-
flow:
3500+
flows:
35043501
implicit:
35053502
authorizationUrl: https://example.com/api/oauth/dialog
35063503
scopes:

0 commit comments

Comments
 (0)