Specification of apidoc api.json schema

apidoc

Example JSON: |
FieldTypeDescription
version requiredstring e.g. 1.0.3

application

Example JSON: |
FieldTypeDescription
key requiredstring Unique key identifying this application

body

Example JSON: |
FieldType
type requiredstring
description string
deprecation deprecation

deprecation

Example JSON: |

Indicates that this particular element is considered deprecated in the API. See the description for details

FieldType
description string

enum

Example JSON: |
FieldType
name requiredstring
plural requiredstring
description string
deprecation deprecation
values required[enum_value]

enum_value

Example JSON: |
FieldType
name requiredstring
description string
deprecation deprecation

field

Example JSON: |
FieldType
name requiredstring
type requiredstring
description string
deprecation deprecation
default string
required requiredboolean
minimum long
maximum long
example string

import

Example JSON: |

An import is used to declare a dependency on another application. This allows you to reference the models and or enums from that application in your own app.

FieldTypeDescription
uri requiredstring Full URI to the service.json file of the service we are importing e.g. http://www.apidoc.me/gilt/apidoc-spec/0.7.38/service.json
namespace requiredstring the fully qualified namespace that we have imported e.g. com.gilt.apidoc
organization requiredorganization
application requiredapplication
version requiredstring The version of the service that we are importing e.g. 1.0.0
enums required[string]default: [] Models made available by this import
unions required[string]default: [] Unions made available by this import
models required[string]default: [] Models made available by this import

model

Example JSON: |
FieldType
name requiredstring
plural requiredstring
description string
deprecation deprecation
fields required[field]

operation

Example JSON: |
FieldTypeDescription
method requiredmethod
path requiredstring
description string
deprecation deprecation
body body
parameters required[parameter]default: []
responses required[response]default: []

organization

Example JSON: |
FieldTypeDescription
key requiredstring Unique key identifying the organization that owns this service

parameter

Example JSON: |
FieldType
name requiredstring
type requiredstring
location requiredparameter_location
description string
deprecation deprecation
required requiredboolean
default string
minimum long
maximum long
example string

resource

Example JSON: |
FieldTypeDescription
type requiredstring The type of this resource will map to a defined model, enum, or union type
plural requiredstring
description string
deprecation deprecation
operations required[operation]

response

Example JSON: |
FieldType
code requiredresponse_code
type requiredstring
description string
deprecation deprecation

service

Example JSON: |
FieldTypeDescription
apidoc requiredapidoc Documents that this is an apidoc document, noting the specific version used. Internally the version is then used for backwards compatibility when applicable as new features are added to apidoc.
name requiredstring
organization requiredorganization
application requiredapplication
namespace requiredstring Fully qualified namespace for this service e.g. com.gilt.apidoc
version requiredstring e.g. 1.0.0
base_url string
description string
headers required[header]default: []
imports required[import]default: []
enums required[enum]default: []
unions required[union]default: []
models required[model]default: []
resources required[resource]default: []

union

Example JSON: |
FieldTypeDescription
name requiredstring
plural requiredstring
description string
deprecation deprecation
types required[union_type] min: 1 The names of the types that make up this union type

union_type

Example JSON: |

Metadata about one of the types that is part of a union type

FieldTypeDescription
type requiredstring The name of a type (a primitive, model name, or enum name) that makes up this union type
description string
deprecation deprecation