Specification of swagger using the apibuilder format

contact

Example JSON: |
FieldType
name string
url string
email string

external_documentation

Example JSON: |
FieldType
description string
url requiredstring

info

Example JSON: |
FieldType
title requiredstring
description string
termsOfService string
contact contact
license license
version requiredstring

items

Example JSON: |
FieldTypeDescription
type requireditems_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

Example JSON: |
FieldType
name requiredstring
url string

operation

Example JSON: |
FieldType
tags [string]
summary string
description string
externalDocs external_documentation
operationId string
consumes [string]
produces [string]
parameters [parameter_or_ref]
responses requiredmap[response_or_ref]
schemes [string]
deprecated boolean
security [map[[string]]]

parameter

Example JSON: |

TODO: This might need to be a complex union type, given the different requirements based on the 'in' property. http://swagger.io/specification/#parameterObject

FieldType
name requiredstring
in requiredparameter_in_type
description string
required requiredboolean
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

Example JSON: |
FieldTypeDescription
ref string TODO: Needs to be named '$ref'
get operation
put operation
post operation
delete operation
options operation
head operation
patch operation
parameters [parameter_or_ref]

reference

Example JSON: |
FieldTypeDescription
ref requiredstring TODO: Needs to be named '$ref'

response

Example JSON: |
FieldType
description requiredstring
schema schema
headers map[header]
examples object

schema

Example JSON: |
FieldTypeDescription
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

Example JSON: |

TODO: Consider making this a union type of the three different schemes (and their required fields)

FieldTypeDescription
type requiredsecurity_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

Example JSON: |
FieldType
swagger requiredstring
info requiredinfo
host string
basePath string
schemes [string]
consumes [string]
produces [string]
paths requiredmap[path_item]
definitions map[schema]
parameters map[parameter]
responses map[response]
securityDefinitions map[security_scheme]
security map[string]
tags [tag]
externalDocs external_documentation

tag

Example JSON: |
FieldType
name requiredstring
description string
externalDocs external_documentation

xml

Example JSON: |
FieldType
name string
namespace string
prefix string
attribute boolean
wrapped boolean