This repository has been archived by the owner on Feb 7, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci skip] Automated merge stage->master.
- Loading branch information
Showing
7 changed files
with
116 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#%RAML 1.0 | ||
title: My API with Types | ||
mediaType: application/json | ||
types: | ||
Org: | ||
type: object | ||
properties: | ||
onCall: Alertable # inherits all properties from type `Alertable` | ||
Head: Manager # inherits all properties from type `Manager` | ||
Person: | ||
type: object | ||
discriminator: kind # reference to the `kind` property of `Person` | ||
properties: | ||
firstname: string | ||
lastname: string | ||
title?: string | ||
kind: string # may be used to differenciate between classes that extend from `Person` | ||
Phone: | ||
type: string | ||
pattern: "^[0-9|-]+$" # defines pattern for the content of type `Phone` | ||
Manager: | ||
type: Person # inherits all properties from type `Person` | ||
properties: | ||
reports: Person[] # inherits all properties from type `Person`; array type where `[]` is a shortcut | ||
phone: Phone | ||
Admin: | ||
type: Person # inherits all properties from type `Person` | ||
properties: | ||
clearanceLevel: | ||
enum: [ low, high ] | ||
AlertableAdmin: | ||
type: Admin # inherits all properties from type `Admin` | ||
properties: | ||
phone: Phone # inherits all properties from type `Phone`; uses shortcut syntax | ||
Alertable: Manager | AlertableAdmin # union type; either a `Manager` or `AlertableAdmin` | ||
/{orgId}: | ||
get: | ||
responses: | ||
200: | ||
body: | ||
application/json: | ||
type: Org # reference to global type definition | ||
example: | ||
onCall: | ||
firstname: nico | ||
lastname: ark | ||
kind: admin | ||
clearanceLevel: low | ||
phone: "12321" | ||
Head: | ||
firstname: nico | ||
lastname: ark | ||
kind: manager | ||
reports: | ||
- | ||
firstname: nico | ||
lastname: ark | ||
kind: admin | ||
phone: "123-23" |