Specification of swagger using the apibuilder format
contact
| Field | Type |
|---|---|
| name | string |
| url | string |
| string |
external_documentation
| Field | Type |
|---|---|
| description | string |
| url required | string |
header
TODO: Can this be a union type with items?
| Field | Type | Description |
|---|---|---|
| description | string | |
| type required | items_type | |
| format | format_type | |
| items | items | NOTE: This is required if type is 'array' |
| collectionFormat | collection_format_type | |
| default | object | |
| maximum | long | |
| exclusiveMaximum | boolean | |
| minimum | long | |
| exclusiveMinimum | boolean | |
| maxLength | integer | |
| minLength | integer | |
| pattern | string | |
| maxItems | integer | |
| minItems | integer | |
| uniqueItems | boolean | |
| enum | [object] | |
| multipleOf | long |
info
items
| Field | Type | Description |
|---|---|---|
| type required | items_type | |
| format | format_type | |
| items | items | NOTE: This is required if type is 'array' |
| collectionFormat | collection_format_type | |
| default | object | |
| maximum | long | |
| exclusiveMaximum | boolean | |
| minimum | long | |
| exclusiveMinimum | boolean | |
| maxLength | integer | |
| minLength | integer | |
| pattern | string | |
| maxItems | integer | |
| minItems | integer | |
| uniqueItems | boolean | |
| enum | [object] | |
| multipleOf | long |
license
| Field | Type |
|---|---|
| name required | string |
| url | string |
operation
| Field | Type |
|---|---|
| tags | [string] |
| summary | string |
| description | string |
| externalDocs | external_documentation |
| operationId | string |
| consumes | [string] |
| produces | [string] |
| parameters | [parameter_or_ref] |
| responses required | map[response_or_ref] |
| schemes | [string] |
| deprecated | boolean |
| security | [map[[string]]] |
parameter
TODO: This might need to be a complex union type, given the different requirements based on the 'in' property. http://swagger.io/specification/#parameterObject
| Field | Type |
|---|---|
| name required | string |
| in required | parameter_in_type |
| description | string |
| required required | boolean |
| schema | schema |
| type | string |
| format | string |
| allowEmptyValue | boolean |
| items | items |
| collectionFormat | collection_format_type |
| default | object |
| maximum | long |
| exclusiveMaximum | boolean |
| minimum | long |
| exclusiveMinimum | boolean |
| maxLength | integer |
| minLength | integer |
| pattern | string |
| maxItems | integer |
| minItems | integer |
| uniqueItems | boolean |
| enum | [object] |
| multipleOf | long |
path_item
reference
| Field | Type | Description |
|---|---|---|
| ref required | string | TODO: Needs to be named '$ref' |
response
schema
| Field | Type | Description |
|---|---|---|
| ref | string | TODO: Needs to be named '$ref' |
| format | format_type | |
| title | string | |
| description | string | |
| default | object | |
| multipleOf | long | |
| maximum | long | |
| exclusiveMaximum | boolean | |
| minimum | long | |
| exclusiveMinimum | boolean | |
| maxLength | integer | |
| minLength | integer | |
| pattern | string | |
| maxItems | integer | |
| minItems | integer | |
| uniqueItems | boolean | |
| maxProperties | integer | |
| minProperties | integer | |
| required | [string] | |
| enum | [object] | |
| type | [string] | |
| items | schema | TODO: figure out if this also needs to support boolean (http://json-schema.org/latest/json-schema-validation.html#rfc.section.5.9). It's possible that a uni-directional approach may allow us to avoid supporting this odd type. |
| allOf | [schema] | |
| properties | map[schema] | |
| additionalProperties | schema | TODO: figure out if this also needs to support boolean (http://json-schema.org/latest/json-schema-validation.html#rfc.section.5.18). It's possible that a uni-directional approach may allow us to avoid supporting this odd type. |
| discriminator | string | |
| readOnly | boolean | |
| xml | xml | |
| externalDocs | external_documentation | |
| example | object |
security_scheme
TODO: Consider making this a union type of the three different schemes (and their required fields)
| Field | Type | Description |
|---|---|---|
| type required | security_scheme_type | |
| description | string | |
| name | string | Required for apiKey |
| in | api_key_in_type | Required for apiKey |
| flow | string | Required for oauth2 |
| authorizationUrl | string | Required for oauth2 |
| tokenUrl | string | Required for oauth2 |
| scopes | map[string] | Required for oauth2 |
swagger
| Field | Type |
|---|---|
| swagger required | string |
| info required | info |
| host | string |
| basePath | string |
| schemes | [string] |
| consumes | [string] |
| produces | [string] |
| paths required | map[path_item] |
| definitions | map[schema] |
| parameters | map[parameter] |
| responses | map[response] |
| securityDefinitions | map[security_scheme] |
| security | map[string] |
| tags | [tag] |
| externalDocs | external_documentation |
tag
| Field | Type |
|---|---|
| name required | string |
| description | string |
| externalDocs | external_documentation |
xml
| Field | Type |
|---|---|
| name | string |
| namespace | string |
| prefix | string |
| attribute | boolean |
| wrapped | boolean |