Format Overview
This page overviews spec format
Last updated
This page overviews spec format
Last updated
Spec format is based on YAML. Each spec file is a YAML file. In many aspects spec format resembles to . Main purpose of spec is to provide more compact (then OpenAPI) way of defining API and also limit some capabilities of OpenAPI.
Here's an example of simplest spec:
Spec YAML file consists of following sections:
Meta information
HTTP
Models
Meta information is presented in form for keys at the top level of the YAML file. In the example above spec
, name
and version
are meta information fields.
Here's the list of supported meta information fields:
spec
Version of spec format, current latest format is 2.1
name
Name of the specification
version
Version of the specification
Models are defined in models
section of the spec. This section allows to define custom user types, including object models, enums, and tagged unions. These user-defined models can be used in endpoints where needed by their names.
HTTP endpoints are defined in http
section of the spec. Endpoints are grouped in APIs. APIs are used in code generation and should bundle together related endpoints. Read more about endpoints in the section.
Read more about endpoints in the section.