📋Project configuration

Each project created or edited through the CLI is configured using a JSON file which defines your project's configuration. This is a complete reference of the available properties.

Project object

Property name
Type
Description

name

String

The name of your project. This can be changed later

models

api

The configuration of your API.

Model object

Property name
Type
Description

primary_key

String | String[]

properties

Object {

}

Property object

Property name
Type
Description

type

'string' | 'boolean' | 'number' | 'date' | 'timestamp' | 'array' | 'reference'

The type of your property. If it set to array, then items must be defined. If it set to reference, then reference must be defined.

nullable

Boolean

Indicates whether the property is nullable in the database or not. If not specified, the default value is true.

readonly

Boolean

A readonly property will never be able to be set by the client, on create or update operations.

unique

Boolean

Indicates that the associated value can only exist once in the database.

reference

String

A reference to an existing property. It must only be used if type is set to reference. The value must match the name of one your model (eg. Planet), or one of your model's property (eg. Planet/name)

items

Must only be used if type is set to array.

API object

Property name
Type
Description

info

A description of your API.

paths

Object {

}

Info object

Property name
Type
Description

title

String

The name of your API

description

String

A short description of your API

version

String

A semver-compatible version (eg. 1.0.0)

Path object

Property name
Type
Description

methods

Object {

}

parameters

paths

Parameters defined at the path level apply to all its methods, but also its subpath methods. If you only wish to define a parameter for a single method, define the parameter at the method level.

Method object

Property name
Type
Description

operationId

String

A unique identifier for your endpoint

description

String

A short description of what your endpoint does

parameters

body

A property describing the body of the HTTP request. It must only be used on POST, PUT or PATCH endpoints.

responses

Object {

}

Parameter object

Property name
Type
Description

name

String

The name of your parameter. The couple (name, in) must be unique.

description

String

A description of what your parameter does.

in

'path' | 'query'

Defines where to expect the parameter, either in path or query. If it set to path, then the path must include a URL parameter of the same name, using the format: /path/:param

required

Boolean

Makes the parameter mandatory. It can only be used for query parameters, as path parameters are always required.

Last updated