-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Quick stab at acctual vocab + meta for schema objects
- Loading branch information
Phil Sturgeon
committed
Jun 21, 2019
1 parent
f9ed32b
commit 42ed2ce
Showing
2 changed files
with
1,599 additions
and
56 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,198 @@ | ||
{ | ||
"$schema": "https://spec.openapis.org/oas/3.1/schema#", | ||
"$id": "https://spec.openapis.org/oas/3.1/meta", | ||
"$vocabulary": { | ||
"https://specs.openapis.org/oas/3.1/vocab/openapi": true | ||
}, | ||
"$recursiveAnchor": true, | ||
"title": "OpenAPI Vocabulary Schema", | ||
"type": ["object", "boolean"], | ||
"$schema": "http://json-schema.org/draft/2019-WIP/schema#", | ||
"$id": "https://spec.openapis.org/oas/3.1/meta", | ||
"$vocabulary": { | ||
"https://specs.openapis.org/oas/3.1/vocab/openapi": true | ||
}, | ||
"$recursiveAnchor": true, | ||
"title": "OpenAPI Vocabulary Schema", | ||
"type": ["object", "boolean"], | ||
"properties": { | ||
"type": { | ||
"type": "string", | ||
"enum": [ | ||
"array", | ||
"boolean", | ||
"integer", | ||
"number", | ||
"object", | ||
"string" | ||
] | ||
}, | ||
"not": { | ||
"oneOf": [ | ||
{ | ||
"$ref": "#/$defs/Schema" # can i use recursiveAnchor for this or how do i ref myself | ||
}, | ||
{ | ||
"$ref": "#/$defs/Reference" // this is in the openapi-vocabulary.json any way to ref back up to it | ||
} | ||
] | ||
}, | ||
"allOf": { | ||
"type": "array", | ||
"items": { | ||
"oneOf": [ | ||
{ | ||
"$ref": "#/$defs/Schema" | ||
}, | ||
{ | ||
"$ref": "#/$defs/Reference" | ||
} | ||
] | ||
} | ||
}, | ||
"oneOf": { | ||
"type": "array", | ||
"items": { | ||
"oneOf": [ | ||
{ | ||
"$ref": "#/$defs/Schema" | ||
}, | ||
{ | ||
"$ref": "#/$defs/Reference" | ||
} | ||
] | ||
} | ||
}, | ||
"anyOf": { | ||
"type": "array", | ||
"items": { | ||
"oneOf": [ | ||
{ | ||
"$ref": "#/$defs/Schema" | ||
}, | ||
{ | ||
"$ref": "#/$defs/Reference" | ||
} | ||
] | ||
} | ||
}, | ||
"items": { | ||
"oneOf": [ | ||
{ | ||
"$ref": "#/$defs/Schema" | ||
}, | ||
{ | ||
"$ref": "#/$defs/Reference" | ||
} | ||
] | ||
}, | ||
"properties": { | ||
"nullable": { | ||
"type": "boolean", | ||
"deprecated": true | ||
}, | ||
"externalDocs": { | ||
"type": "object", | ||
"properties": { | ||
"description": { | ||
"type": "string" | ||
}, | ||
"url": { | ||
"type": "string", | ||
"format": "uri" | ||
} | ||
"type": "object", | ||
"additionalProperties": { | ||
"oneOf": [ | ||
{ | ||
"$ref": "#/$defs/Schema" | ||
}, | ||
"required": ["propertyName"] | ||
}, | ||
"discriminator": { | ||
"type": "object", | ||
"properties": { | ||
"propertyName": { | ||
"type": "string" | ||
}, | ||
"mapping": { | ||
"additionalProperties": { | ||
"type": "string" | ||
} | ||
} | ||
}, | ||
"required": ["propertyName"] | ||
}, | ||
"example": {}, | ||
"xml": { | ||
"type": "object" | ||
{ | ||
"$ref": "#/$defs/Reference" | ||
} | ||
] | ||
} | ||
}, | ||
"additionalProperties": { | ||
"oneOf": [ | ||
{ | ||
"$ref": "#/$defs/Schema" // TODO | ||
}, | ||
{ | ||
"$ref": "#/$defs/Reference" // TODO | ||
}, | ||
{ | ||
"type": "boolean" | ||
} | ||
], | ||
"default": true | ||
}, | ||
"description": { | ||
"type": "string" | ||
}, | ||
"format": { | ||
"type": "string" | ||
}, | ||
"default": { | ||
}, | ||
"nullable": { | ||
"type": "boolean", | ||
"default": false, | ||
"deprecated": true | ||
}, | ||
"discriminator": { | ||
"$ref": "#/$defs/Discriminator" | ||
}, | ||
"readOnly": { | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"writeOnly": { | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"example": { | ||
}, | ||
"externalDocs": { | ||
"$ref": "#/$defs/ExternalDocumentation" // TODO | ||
}, | ||
"deprecated": { | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"xml": { | ||
"$ref": "#/$defs/XML" | ||
} | ||
}, | ||
"patternProperties": { | ||
"^x-": { | ||
} | ||
}, | ||
"additionalProperties": false, | ||
|
||
"$defs": { | ||
"Discriminator": { | ||
"type": "object", | ||
"required": [ | ||
"propertyName" | ||
], | ||
"properties": { | ||
"propertyName": { | ||
"type": "string" | ||
}, | ||
"mapping": { | ||
"type": "object", | ||
"additionalProperties": { | ||
"type": "string" | ||
} | ||
} | ||
} | ||
}, | ||
"XML": { | ||
"type": "object", | ||
"properties": { | ||
"name": { | ||
"type": "string" | ||
}, | ||
"namespace": { | ||
"type": "string", | ||
"format": "uri" | ||
}, | ||
"prefix": { | ||
"type": "string" | ||
}, | ||
"attribute": { | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"wrapped": { | ||
"type": "boolean", | ||
"default": false | ||
} | ||
}, | ||
"patternProperties": { | ||
"^x-": { | ||
} | ||
}, | ||
"additionalProperties": false | ||
} | ||
} | ||
} |
Oops, something went wrong.