Skip to content
This repository has been archived by the owner on Jan 27, 2022. It is now read-only.

Commit

Permalink
fix: Replace $extends and remove unecessary use of object
Browse files Browse the repository at this point in the history
  • Loading branch information
nokome committed Jul 25, 2019
1 parent 88590cc commit b24d8e3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
6 changes: 3 additions & 3 deletions docs/writing-schema-definitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ Just as for types, properties of types can be linked to the other contexts using
type: string
```

## The `$extends` keyword
## The `extends` keyword

This is a custom keyword which allows your type schema to inherit the `properties` and `required` keywords of a parent type schema. It should be a _relative_ file path e.g.
This is a custom keyword which allows your type schema to inherit the `properties` and `required` keywords of a parent type schema. It should be the name of another type e.g.

```yaml
$extends: ../Thing.schema.yaml
extends: Thing
```

## The `role` keyword
Expand Down
1 change: 0 additions & 1 deletion schema/Entity.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ title: Entity
role: base
status: unstable
description: The most basic item, defining the minimum properties required.
type: object
properties:
type:
# This is a special property analagous to JSON-LD's `@type` keyword
Expand Down
3 changes: 1 addition & 2 deletions schema/Thing.schema.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
title: Thing
'@id': schema:Thing
$extends: Entity.schema.yaml
extends: Entity
status: unstable
description: The most generic type of item https://schema.org/Thing.
type: object
properties:
alternateNames:
'@id': schema:alternateName
Expand Down

0 comments on commit b24d8e3

Please sign in to comment.