Fields

Fields document a single parameter, property, or response value as a labelled row: the name as inline code, an optional location badge, a type, flags such as required and deprecated, and a description underneath.

<ParamField> and <ResponseField> are Mintlify-compatible spellings of the same component, so content written for Mintlify renders without a rename. For an OpenAPI-backed route, let the API reference render parameters from the API description instead — fields are for hand-written pages.

Properties

Field

PropTypeDefaultDescription
namestringrequiredThe field's name, rendered as inline code.
typestring—The field's type, shown after the name.
locationstring—Where the parameter lives, such as path or query. Rendered in lowercase.
requiredbooleanfalseAdds a required badge.
deprecatedbooleanfalseAdds a deprecated badge.
defaultstring—Rendered as default: <value>. In Markdown, see Defaults in Markdown.
prestring[]—Labels rendered before the name. In Markdown, a comma-separated list.
poststring[]—Labels rendered after the name. In Markdown, a comma-separated list.
classstring—Extra class names on the field's root element. className also works in MDX.

Both booleans go by presence rather than value, so required on its own is enough — and required="false" still marks the field required. Leave the attribute off instead.

ParamField

<ParamField> accepts everything <Field> accepts, plus one prop per parameter location. The prop name is the location and its value is the parameter name, which is how Mintlify writes it.

PropTypeDefaultDescription
querystring—Query parameter name. Sets the location to query.
pathstring—Path parameter name. Sets the location to path.
bodystring—Body property name. Sets the location to body.
headerstring—Header name. Sets the location to header.
placeholderstring—Accepted for Mintlify compatibility and ignored. There is no playground input here to configure.

If more than one location prop is set, the first of query, path, body, header wins. An explicit name takes precedence over the location prop's value as the displayed name.

ResponseField

<ResponseField> accepts everything <Field> accepts. It is the spelling to reach for when documenting a response value, where there is no parameter location to show.

Examples

Path Parameter

user_idpathstringrequired

The unique identifier of the user.

<scalar-field name="user_id" location="path" type="string" required>

The unique identifier of the user.

</scalar-field>
<ParamField path="user_id" type="string" required>
  The unique identifier of the user.
</ParamField>

Query Parameter with a Default

limitquerynumberdefault: 25

How many results to return per page, between 1 and 100.

<scalar-field name="limit" location="query" type="number" data-default="25">

How many results to return per page, between 1 and 100.

</scalar-field>
<ParamField query="limit" type="number" default="25">
  How many results to return per page, between 1 and 100.
</ParamField>

The Markdown form writes data-default rather than default. Defaults in Markdown explains why.

Header Parameter

Authorizationheaderstringrequired

Bearer token issued from the dashboard.

<scalar-field name="Authorization" location="header" type="string" required>

Bearer token issued from the dashboard.

</scalar-field>
<ParamField header="Authorization" type="string" required>
  Bearer token issued from the dashboard.
</ParamField>

Response Field

created_attimestamp

When the record was created, as an ISO 8601 timestamp.

<scalar-field name="created_at" type="timestamp">

When the record was created, as an ISO 8601 timestamp.

</scalar-field>
<ResponseField name="created_at" type="timestamp">
  When the record was created, as an ISO 8601 timestamp.
</ResponseField>

Labels and Deprecation

pre and post add free-form labels before and after the name. In MDX they take an array or a comma-separated string; in Markdown, a comma-separated string.

betamodebodystringdeprecatedread-only

Rendering mode for the generated page.

<scalar-field name="mode" location="body" type="string" deprecated pre="beta" post="read-only">

Rendering mode for the generated page.

</scalar-field>
<ParamField body="mode" type="string" deprecated pre="beta" post="read-only">
  Rendering mode for the generated page.
</ParamField>

Stacked Fields

Fields need no wrapper. Write them one after another and they stack.

firststring

The first of two adjacent fields.

secondstring

The second of two adjacent fields.

<scalar-field name="first" type="string">

The first of two adjacent fields.

</scalar-field>

<scalar-field name="second" type="string">

The second of two adjacent fields.

</scalar-field>
<Field name="first" type="string">
  The first of two adjacent fields.
</Field>

<Field name="second" type="string">
  The second of two adjacent fields.
</Field>

Defaults in Markdown

default is a boolean attribute to the HTML parser, so <scalar-field default="25"> arrives as true with the value lost. Rather than render default: true, the field drops it. Two spellings keep the real value:

<scalar-field name="limit" type="number" data-default="25">

How many results to return.

</scalar-field>

Any attribute accepts a data- prefixed fallback, which the HTML parser leaves alone. The directive form is the other option, and it writes default directly.

This only affects raw HTML in .md files. In MDX, default="25" is a plain prop and works as written.

Directive Syntax

Markdown pages can also write a field as a container directive, which avoids the default problem entirely:

:::scalar-field{name=limit type=number default=25 deprecated}
How many results to return.
:::

One difference to know about: attribute names that HTML treats as booleans need an explicit value here. required on its own is dropped, so write required=true:

:::scalar-field{name=token type=string required=true}
The API token.
:::

Names HTML does not know as booleans, such as deprecated, keep presence semantics and work bare — as in the first example above.

What did you think of this content?