Skip to content

Instantly share code, notes, and snippets.

@chriskapp
Last active March 5, 2021 19:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chriskapp/61bc8b3029c7cb88d82c7c2ddbf1d19d to your computer and use it in GitHub Desktop.
Save chriskapp/61bc8b3029c7cb88d82c7c2ddbf1d19d to your computer and use it in GitHub Desktop.
{
"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