Ariadocs

OpenAPI.Schema

Edit on GitHub

The fields of a schema.

Here's Resend's Email schema:

Preview
objectstring

The type of object.

idstring

The ID of the email.

message_idstring

The Message-ID header value of the email.

tostring[]
fromstring

The email address of the sender.

created_atstring

The date and time the email was created.

subjectstring

The subject line of the email.

htmlstring

The HTML body of the email.

textstring

The plain text body of the email.

bccstring[]

The email addresses of the blind carbon copy recipients.

ccstring[]

The email addresses of the carbon copy recipients.

reply_tostring[]

The email addresses to which replies should be sent.

last_eventstring

The status of the email.

One of: "bounced""canceled""clicked""complained""delivered""delivery_delayed""failed""opened""queued""scheduled""sent""suppressed"
<OpenAPI.Schema schema={api.schemas.Email} name="Email" mode="response" />

Each field shows its name, type, whether it's required, its description and its limits. Fields that hold objects or lists of objects can be expanded. When a field can take several shapes (oneOf or anyOf), tabs switch between them. A schema that contains itself shows a note instead of repeating forever.

PropWhat it does
schemaThe schema to show
nameThe name shown by OpenAPI.Schema.Title
mode"request" hides read-only fields. "response" hides write-only fields.

To choose the parts:

<OpenAPI.Schema schema={schema} name="Email">
  <OpenAPI.Schema.Title />
  <OpenAPI.Schema.Description />
  <OpenAPI.Schema.Properties mode="response" />
</OpenAPI.Schema>

The Schemas page of the API Reference lists every schema this way.