Create Schema
POST {{url}}/apis/{{apiId}}/versions/{{apiVersionId}}/schemas
This call creates a new schema.
Request body should contain a schema
object which should atleast have these properties with string
values:
type
: Allowed types areopenapi3
,openapi2
,openapi1
,raml
andgraphql
.language
: Allowed languages arejson
andyaml
for OpenAPI and RAML schema types. GraphQL schema type accepts onlygraphql
language.schema
: Optional. If passed, must be the content of the schema as astring
.
Response contains a schema
object with all the details related to the created schema, namely, id
, language
, type
etc.
Requires API Key as
X-Api-Key
request header orapikey
URL query parameter.
Request Body
{"schema"=>{"language"=>"yaml", "schema"=>"{}", "type"=>"openapi3"}}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
x-api-key | string | ||
Content-Type | string |
RESPONSES
status: OK
{"schema":{"id":"e3b3a0b7-34d5-4fc5-83e0-118bd9e8c822","language":"yaml","apiVersion":"ad810c39-df60-434e-a76f-a2192cd8d81f","type":"openapi3","createdBy":"5665","updateBy":"5665","createdAt":"2019-02-12 19:34:49","updatedAt":"2019-02-12 19:34:49"}}