Skip to content

Do not rely on auto-detection of fenced code block languages #1603

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 2, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 attribute is legal only when using one of the composite keywor

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": "cachorro",
"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