Specification of apidoc api.json schema
apidoc
| Field | Type | Description |
|---|---|---|
| version required | string | e.g. 1.0.3 |
application
| Field | Type | Description |
|---|---|---|
| key required | string | Unique key identifying this application |
body
| Field | Type |
|---|---|
| type required | string |
| description | string |
| deprecation | deprecation |
deprecation
Indicates that this particular element is considered deprecated in the API. See the description for details
| Field | Type |
|---|---|
| description | string |
enum
| Field | Type |
|---|---|
| name required | string |
| plural required | string |
| description | string |
| deprecation | deprecation |
| values required | [enum_value] |
enum_value
| Field | Type |
|---|---|
| name required | string |
| description | string |
| deprecation | deprecation |
field
| Field | Type |
|---|---|
| name required | string |
| type required | string |
| description | string |
| deprecation | deprecation |
| default | string |
| required required | boolean |
| minimum | long |
| maximum | long |
| example | string |
header
| Field | Type |
|---|---|
| name required | string |
| type required | string |
| description | string |
| deprecation | deprecation |
| required required | boolean |
| default | string |
import
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.
| Field | Type | Description |
|---|---|---|
| uri required | string | 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 required | string | the fully qualified namespace that we have imported e.g. com.gilt.apidoc |
| organization required | organization | |
| application required | application | |
| version required | string | 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
| Field | Type |
|---|---|
| name required | string |
| plural required | string |
| description | string |
| deprecation | deprecation |
| fields required | [field] |
operation
| Field | Type | Description |
|---|---|---|
| method required | method | |
| path required | string | |
| description | string | |
| deprecation | deprecation | |
| body | body | |
| parameters required | [parameter] | default: [] |
| responses required | [response] | default: [] |
organization
| Field | Type | Description |
|---|---|---|
| key required | string | Unique key identifying the organization that owns this service |
parameter
| Field | Type |
|---|---|
| name required | string |
| type required | string |
| location required | parameter_location |
| description | string |
| deprecation | deprecation |
| required required | boolean |
| default | string |
| minimum | long |
| maximum | long |
| example | string |
resource
| Field | Type | Description |
|---|---|---|
| type required | string | The type of this resource will map to a defined model, enum, or union type |
| plural required | string | |
| description | string | |
| deprecation | deprecation | |
| operations required | [operation] |
response
| Field | Type |
|---|---|
| code required | response_code |
| type required | string |
| description | string |
| deprecation | deprecation |
service
| Field | Type | Description |
|---|---|---|
| apidoc required | apidoc | 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 required | string | |
| organization required | organization | |
| application required | application | |
| namespace required | string | Fully qualified namespace for this service e.g. com.gilt.apidoc |
| version required | string | 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
| Field | Type | Description |
|---|---|---|
| name required | string | |
| plural required | string | |
| description | string | |
| deprecation | deprecation | |
| types required | [union_type] | min: 1 The names of the types that make up this union type |
union_type
Metadata about one of the types that is part of a union type
| Field | Type | Description |
|---|---|---|
| type required | string | The name of a type (a primitive, model name, or enum name) that makes up this union type |
| description | string | |
| deprecation | deprecation |