Previous: The OpenAPI structure and custom attributes | Next: Base, mini, standard, and full API resources
Response schemas are located in the content/responses/ folder. Every response
is written as a YAML file.
- Determine the type of the
resource, either arequestresponseerrorcallback- or generic
schema
- Based on that answer, create a file in
content/requests/*content/responses/*content/errors/*,content/callbacks/*- or
content/schemas/* - An example would be
content/responses/file.yml.
- Add the default content to the file:
- A short
titleto give the resource a short human-readable name. Please do not usea,an, orthein the title. - A
descriptionto further elaborate on the title. - A
type, which in most cases is either anobjector anarray. - A unique
x-box-resource-idif you want the schema to be listed in the public developer documentation. Omitting this will hide the resource. - A a list of
propertiesfor each of the fields of the resource.
- A short
---
title: File
description: The information about a file
type: object
x-box-resource-id: file
properties:
id:
type: string
description: The unique identifier for this file
example: "11446498"
type:
description: |-
The type of this file, which is always `file`.
type: string
example: file
enum:
- fileAlmost every schema has a list of properties. Please make sure that every
property:
- has a
typeand optionalformat, for examplestringanddate-time. - has a
descriptionand a realisticexample - has an
enumof values if the returned values are only a limited list - is separated by a new line to improve readability
To learn more about the OpenAPI specification and creating schemas, we recommend reading the following resources.