Skip to content

Examples for relative/separate schema in Reference Object #387

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 2 commits into from
Jun 5, 2015
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
22 changes: 22 additions & 0 deletions versions/2.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -1126,6 +1126,28 @@ Field Name | Type | Description
$ref: '#/definitions/Pet'
```

##### Relative Schema File Example
```js
{
"$ref": "Pet.json"
}
```

```yaml
$ref: 'Pet.yaml'
```

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missed closing sample (```).

##### Relative Files With Embedded Schema Example
```js
{
"$ref": "definitions.json#/Pet"
}
```

```yaml
$ref: 'definitions.yaml#/Pet'
```

#### <a name="schemaObject"></a>Schema Object

The Schema Object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. This object is based on the [JSON Schema Specification Draft 4](http://json-schema.org/) and uses a predefined subset of it. On top of this subset, there are extensions provided by this specification to allow for more complete documentation.
Expand Down