apibuilder spec 0.16.53

Specification of apibuilder api.json schema

Resources

No resources

Headers

No headers

Imports

No imports

Enums

method

Name Value Description
GET GET

POST POST

PUT PUT

PATCH PATCH

DELETE DELETE

HEAD HEAD

CONNECT CONNECT

OPTIONS OPTIONS

TRACE TRACE

parameter_location

Name Value Description
Path Path

Query Query

Form Form

Header Header

response_code_option

Name Value Description
Default Default

Interfaces

No interfaces

Models

annotation

Example Json: Minimal | Full

Interfaces: None

Used to indicate an API concern for a field that is specific to the field's usage but not necessarily its data type. For example, you might use annotations to mark that certain fields contain PII or PCI data and thus should not be stored once processing is complete. Annotations communicate meaning to consumers of an API and may also be used within an implementation or tooling; for example, using static analysis tools to detect logging of sensitive data.

Field Type Required? Default Description
name string Yes -

description string No -

deprecation deprecation No -

apidoc

Example Json: Minimal | Full

Interfaces: None

Field Type Required? Default Description
version string Yes -

Example: 1.0.3

application

Example Json: Minimal | Full

Interfaces: None

Field Type Required? Default Description
key string Yes -

Unique key identifying this application

attribute

Example Json: Minimal | Full

Interfaces: None

Represents an additional attribute that is attached to one of the objects in apibuilder. The main use case is to capture additional metadata that doesn't necessarily define the API but aids in code generation. Examples would be hints for certain code generators about classes to extend, interfaces to implement, annotations to add, names to assign to certain methods, etc. The specific attributes will be applicable only in the context of the specific code generators usings them.

Field Type Required? Default Description
name string Yes -

value object Yes -

description string No -

deprecation deprecation No -

body

Example Json: Minimal | Full

Interfaces: None

Field Type Required? Default Description
type string Yes -

description string No -

deprecation deprecation No -

attributes [attribute] Yes []

contact

Example Json: Minimal | Full

Interfaces: None

Describes the primary contact for this service

Field Type Required? Default Description
name string No -

Example: Michael Bryzek

url string No -

Example: https://www.apibuilder.io

email string No -

Example: michael@test.apibuilder.io

deprecation

Example Json: Minimal | Full

Interfaces: None

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

Field Type Required? Default Description
description string No -

enum

Example Json: Minimal | Full

Interfaces: None

Field Type Required? Default Description
name string Yes -

plural string Yes -

description string No -

deprecation deprecation No -

values [enum_value] Yes -

attributes [attribute] Yes []

enum_value

Example Json: Minimal | Full

Interfaces: None

Field Type Required? Default Description
name string Yes -

description string No -

deprecation deprecation No -

attributes [attribute] Yes []

value string No -

The actual string representation of this value. If not specified, defaults to 'name'

field

Example Json: Minimal | Full

Interfaces: None

Field Type Required? Default Description
name string Yes -

type string Yes -

description string No -

deprecation deprecation No -

default string No -

required boolean Yes -

minimum long No -

maximum long No -

example string No -

attributes [attribute] Yes []

annotations [string] No []

header

Example Json: Minimal | Full

Interfaces: None

Field Type Required? Default Description
name string Yes -

type string Yes -

description string No -

deprecation deprecation No -

required boolean Yes -

default string No -

attributes [attribute] Yes []

import

Example Json: Minimal | Full

Interfaces: None

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 Required? Default Description
uri string Yes -

Full URI to the service.json file of the service we are importing

Example: https://www.apibuilder.io/apicollective/apibuilder-spec/0.7.38/service.json

namespace string Yes -

the fully qualified namespace that we have imported

Example: io.apibuilder

organization organization Yes -

application application Yes -

version string Yes -

The version of the service that we are importing

Example: 1.0.0

enums [string] Yes []

Enums made available by this import

interfaces [string] No []

Interfaces made available by this import

unions [string] Yes []

Unions made available by this import

models [string] Yes []

Models made available by this import

annotations [annotation] No []

Annotations made available by this import

info

Example Json: Minimal | Full

Interfaces: None

General metadata about this service

Field Type Required? Default Description
license license No -

contact contact No -

interface

Example Json: Minimal | Full

Interfaces: None

Field Type Required? Default Description
name string Yes -

plural string Yes -

description string No -

deprecation deprecation No -

fields [field] Yes -

attributes [attribute] Yes []

license

Example Json: Minimal | Full

Interfaces: None

Describes the software license contact for this service

Field Type Required? Default Description
name string Yes -

Example: MIT

url string No -

Example: http://opensource.org/licenses/MIT

model

Example Json: Minimal | Full

Interfaces: None

Field Type Required? Default Description
name string Yes -

plural string Yes -

description string No -

deprecation deprecation No -

fields [field] Yes -

attributes [attribute] Yes []

interfaces [string] No []

operation

Example Json: Minimal | Full

Interfaces: None

Field Type Required? Default Description
method method Yes -

path string Yes -

The full path to this operation, relative to the service's base url.

description string No -

deprecation deprecation No -

body body No -

parameters [parameter] Yes []

responses [response] Yes []

attributes [attribute] Yes []

organization

Example Json: Minimal | Full

Interfaces: None

Field Type Required? Default Description
key string Yes -

Unique key identifying the organization that owns this service

parameter

Example Json: Minimal | Full

Interfaces: None

Field Type Required? Default Description
name string Yes -

type string Yes -

location parameter_location Yes -

description string No -

deprecation deprecation No -

required boolean Yes -

default string No -

minimum long No -

maximum long No -

example string No -

attributes [attribute] No -

resource

Example Json: Minimal | Full

Interfaces: None

Field Type Required? Default Description
type string Yes -

The type of this resource will map to a defined model, enum, or union type

plural string Yes -

path string No -

The path to this specific resource. This was added in 2016 to help us differentiate between the resource path and the operation path which can be helpful when, for example, generating method names for operations. This field is optional as some of our input formats (e.g. swagger) do not explicitly differentiate resoure paths.

description string No -

deprecation deprecation No -

operations [operation] Yes -

attributes [attribute] Yes []

response

Example Json: Minimal | Full

Interfaces: None

Field Type Required? Default Description
code response_code Yes -

type string Yes -

headers [header] No -

description string No -

deprecation deprecation No -

attributes [attribute] No -

service

Example Json: Minimal | Full

Interfaces: None

Field Type Required? Default Description
apidoc apidoc No -

Documents that this is an apibuilder document, noting the specific version used. Internally the version is then used for backwards compatibility when applicable as new features are added to apibuilder. Note naming refers to the original name of this project, 'apidoc', and is left here to avoid a breaking change for preexisting services.

deprecated:

This field is no longer used in API Builder and may be removed in the future.

name string Yes -

organization organization Yes -

application application Yes -

namespace string Yes -

Fully qualified namespace for this service

Example: io.apibuilder

version string Yes -

Example: 1.0.0

base_url string No -

description string No -

info info Yes -

headers [header] Yes []

imports [import] Yes []

enums [enum] Yes []

interfaces [interface] No []

unions [union] Yes []

models [model] Yes []

resources [resource] Yes []

attributes [attribute] Yes []

annotations [annotation] No []

union

Example Json: Minimal | Full

Interfaces: None

Field Type Required? Default Description
name string Yes -

plural string Yes -

discriminator string No -

If a type discriminator is provided, serialization of these union types will always contain a field named with the value of the discriminator that will contain the name of the type. This provides a simpler (for many use cases) JSON serialization/deserialization mechanism. When specified, apibuilder itself will verify that none of the types in the union type itself contain a field with the same name as the discriminator

Example: discriminator or type

description string No -

deprecation deprecation No -

types [union_type] Yes -

The names of the types that make up this union type

Minimum: 1

attributes [attribute] Yes []

interfaces [string] No []

union_type

Example Json: Minimal | Full

Interfaces: None

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

Field Type Required? Default Description
type string Yes -

The name of a type (a primitive, model name, or enum name) that makes up this union type

description string No -

deprecation deprecation No -

attributes [attribute] Yes []

default boolean No -

If true, indicates that this type should be used as the default when deserializing union types. This field is only used by union types that require a discriminator and sets the default value for that discriminator during deserialization.

discriminator_value string No -

The discriminator value defines the string to use in the discriminator field to identify this type. If not specified, the discriminator value will default to the name of the type itself.

Unions

response_code

Interfaces: None

  • Type discriminator: N/A
Type Discriminator Value Example Json Description
integer integer Minimal | Full

Documents an HTTP status code (e.g. 200, 409, etc.)

response_code_option response_code_option Minimal | Full

An individual operation can specify a response code of default to handle all other response codes. This is most useful for providing consistent error handling from an operation.

Annotations

No annotations