Last active
March 5, 2021 19:11
-
-
Save chriskapp/61bc8b3029c7cb88d82c7c2ddbf1d19d to your computer and use it in GitHub Desktop.
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
{ | |
"definitions": { | |
"Category": { | |
"description": "A category for a pet", | |
"type": "object", | |
"properties": { | |
"id": { | |
"type": "integer", | |
"format": "int64" | |
}, | |
"name": { | |
"type": "string", | |
"pattern": "^[a-zA-Z0-9]+[a-zA-Z0-9\\.\\-_]*[a-zA-Z0-9]+$" | |
} | |
} | |
}, | |
"Tag": { | |
"description": "A tag for a pet", | |
"type": "object", | |
"properties": { | |
"id": { | |
"type": "integer", | |
"format": "int64" | |
}, | |
"name": { | |
"type": "string" | |
} | |
} | |
}, | |
"FooItem": { | |
"type": "object", | |
"properties": { | |
"foo": { | |
"type": "string" | |
} | |
} | |
}, | |
"BarItem": { | |
"type": "object", | |
"properties": { | |
"bar": { | |
"type": "string" | |
} | |
} | |
}, | |
"Pet": { | |
"description": "A pet for sale in the pet store", | |
"type": "object", | |
"required": [ | |
"name", | |
"photoUrls" | |
], | |
"properties": { | |
"id": { | |
"type": "integer", | |
"format": "int64" | |
}, | |
"simple_oneof": { | |
"oneOf": [ | |
{ | |
"$ref": "Category" | |
}, | |
{ | |
"$ref": "Tag" | |
} | |
] | |
}, | |
"array_inline": { | |
"type": "array", | |
"items": { | |
"$ref": "FooItem" | |
} | |
}, | |
"simple_allof": { | |
"allOf": [ | |
{ | |
"$ref": "FooItem" | |
}, | |
{ | |
"$ref": "BarItem" | |
} | |
] | |
}, | |
"array_with_union": { | |
"type": "array", | |
"items": { | |
"oneOf": [ | |
{ | |
"$ref": "FooItem" | |
}, | |
{ | |
"$ref": "BarItem" | |
} | |
] | |
} | |
}, | |
"name": { | |
"type": "string", | |
"example": "doggie" | |
}, | |
"photoUrls": { | |
"type": "array", | |
"items": { | |
"type": "string" | |
} | |
}, | |
"tags": { | |
"type": "array", | |
"items": { | |
"$ref": "Tag" | |
} | |
}, | |
"status": { | |
"type": "string", | |
"description": "pet status in the store", | |
"enum": [ | |
"available", | |
"pending", | |
"sold" | |
] | |
} | |
} | |
} | |
}, | |
"$ref": "Pet" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment