Skip to content

Commit

Permalink
Merge pull request OAI#1603 from MikeRalphson/code-block-headings
Browse files Browse the repository at this point in the history
Do not rely on auto-detection of fenced code block languages
  • Loading branch information
webron authored Jul 2, 2018
2 parents cdaab0d + c4841c7 commit ae0ce6b
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions versions/3.0.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens

##### Media Type Examples

```js
```json
{
"application/json": {
"schema": {
Expand Down Expand Up @@ -2689,7 +2689,7 @@ The discriminator object is legal only when using one of the composite keywords

In OAS 3.0, a response payload MAY be described to be exactly one of any number of types:

```
```yaml
MyResponseType:
oneOf:
- $ref: '#/components/schemas/Cat'
Expand All @@ -2700,7 +2700,7 @@ MyResponseType:
which means the payload _MUST_, by validation, match exactly one of the schemas described by `Cat`, `Dog`, or `Lizard`. In this case, a discriminator MAY act as a "hint" to shortcut validation and selection of the matching schema which may be a costly operation, depending on the complexity of the schema. We can then describe exactly which field tells us which schema to use:


```
```yaml
MyResponseType:
oneOf:
- $ref: '#/components/schemas/Cat'
Expand All @@ -2712,7 +2712,7 @@ MyResponseType:

The expectation now is that a property with name `pet_type` _MUST_ be present in the response payload, and the value will correspond to the name of a schema defined in the OAS document. Thus the response payload:

```
```json
{
"id": 12345,
"pet_type": "Cat"
Expand All @@ -2723,7 +2723,7 @@ Will indicate that the `Cat` schema be used in conjunction with this payload.

In scenarios where the value of the discriminator field does not match the schema name or implicit mapping is not possible, an optional `mapping` definition MAY be used:

```
```yaml
MyResponseType:
oneOf:
- $ref: '#/components/schemas/Cat'
Expand All @@ -2745,7 +2745,7 @@ In both the `oneOf` and `anyOf` use cases, all possible schemas MUST be listed e

For example:

```
```yaml
components:
schemas:
Pet:
Expand Down Expand Up @@ -2787,7 +2787,7 @@ components:
a payload like this:
```
```json
{
"pet_type": "Cat",
"name": "misty"
Expand All @@ -2796,7 +2796,7 @@ a payload like this:

will indicate that the `Cat` schema be used. Likewise this schema:

```
```json
{
"pet_type": "dog",
"bark": "soft"
Expand Down Expand Up @@ -3306,7 +3306,7 @@ This object MAY be extended with [Specification Extensions](#specificationExtens
}
```

```YAML
```yaml
type: oauth2
flows:
implicit:
Expand Down

0 comments on commit ae0ce6b

Please sign in to comment.