We aim to keep up with the Swagger 2.0 Specification for both import and export. Because API Builder is a subset of Swagger coverage, there will be some features that we consciously do not support; those gaps will be noted here.
Swagger supports model definitions that are a simple array of another model:
definitions:
Pet:
required:
- id
- name
properties:
id:
type: integer
format: int64
name:
type: string
tag:
type: string
Pets:
type: array
items:
$ref: '#/definitions/Pet'
Because API Builder focuses on the model (and its accompanying resources), plurals (captured as JSON arrays) are
supported natively. Instead of defining a Pets
model as an array, API Builder refers to such an array as [Pet]
. This
centralizes the model definition on a single model that can be used - in single or in multiple - without referring to a
second model for the multiple definition. If you see an error that refers to these array models, you can resolve this
by instead defining the array directly wherever your spec refers to the array model. For example, instead of
responses:
'200':
schema:
$ref: '#/definitions/Pets'
use
responses:
'200':
schema:
type: array
items:
$ref: '#/definitions/Pet'
- Data types
- byte
- binary
- Schema / Parameter Object
- multipleOf
- exclusiveMaximum
- exclusiveMinimum
- maxLength
- minLength
- pattern
- maxItems
- minItems
- uniqueItems
- maxProperties
- minProperties
- additionalProperties
- discriminator
- readOnly
- xml
- default (at the model level, because it can be compiled from the properties)
- tags
- top-level parameters
- top-level responses
- termsOfService
- Operation object
- tags
- summary
- externalDocs
- operationId
- schemes
- deprecated
- security
- Name of body parameter
- externalDocs get appended to the description
- non-JSON produces/consumes (for documentation only) at service & operation level
- collectionFormat on array values
- Data types
- password
- Data types
- decimal (float?)
- object
- unit
- uuid
- Overriding pluralization of model names
- organization
- application
- namespace
- Resource-level description
- Parameter-level example