Last active
April 21, 2021 21:53
-
-
Save jfuerth/42f432cc602cac5dcfb8ebc6baa512d3 to your computer and use it in GitHub Desktop.
An OpenAPI spec for a type that has an which is a JSON Schema
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
openapi: "3.0.2" | |
paths: | |
/table/{tableName}: | |
get: | |
responses: | |
'200': | |
content: | |
application/json: | |
schema: | |
$ref: "#/components/schemas/Table" | |
components: | |
schemas: | |
Table: | |
properties: | |
data_model: | |
$ref: "https://json-schema.org/draft-07/schema#" | |
data: | |
type: array | |
description: Array of rows, each adhering to the schema given in the `data_model` property | |
items: | |
# Each item must conform to the schema provided in the "data_model" section of this Table. | |
# Not sure if this constraint can be expressed better in OpenAPI 3.0. | |
type: object |
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
openapi: "3.0.2" | |
paths: | |
/table/{tableName}: | |
get: | |
responses: | |
'200': | |
content: | |
application/json: | |
schema: | |
$ref: "#/components/schemas/Table" | |
components: | |
schemas: | |
Table: | |
properties: | |
data_model: | |
allOf: | |
- description: A JSON Schema that defines the structure of each row in the data array | |
- $ref: "https://json-schema.org/draft-07/schema#" | |
data: | |
type: array | |
description: Array of rows, each adhering to the schema given in the `data_model` property | |
items: | |
# Each item must conform to the schema provided in the "data_model" section of this Table. | |
# Not sure if this constraint can be expressed better in OpenAPI 3.0. | |
type: object |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment