Fields
Use ParamField and ResponseField components to document API request and response parameters with types, defaults, and validation rules.
Use fields to document API parameters and responses. There are two types of fields: parameter fields and response fields.
Parameter field
Use the <ParamField> component to define parameters for your APIs or SDKs. Adding a ParamField automatically adds an API Playground.
paramstringrequiredAn example of a parameter field
<ParamField path="param" type="string" required>
An example of a parameter field
</ParamField>Properties
query, path, body, or headerstringWhether the parameter is a query, path, body, or header. Followed by the parameter name.
typestringExpected type of the parameter’s value.
Supports number, string, boolean, object.
Define arrays using the [] suffix. For example string[].
requiredbooleanIndicate whether you require the parameter.
deprecatedbooleanIndicate whether you have deprecated the parameter.
defaultanyDefault value populated when the request value is empty
placeholderstringPlaceholder text for the input in the playground.
childrenstringDescription of the parameter (Markdown-enabled).
Response field
The <ResponseField> component defines the return values of an API.
responsestringrequiredAn example of a response field
<ResponseField name="response" type="string" required>
A response field example
</ResponseField>Properties
namestringrequiredThe name of the response value.
typestringrequiredExpected type of the response value. This can be any arbitrary string.
defaultstringThe default value.
requiredbooleanIndicate whether you require the response.
deprecatedbooleanWhether you have deprecated a field.
prestring[]Labels that appear before the name of the field.
poststring[]Labels that appear after the name of the field.