Embed an ERD, OpenAPI, or MDX attachment on a model object.
The Attachment component embeds an ERD, an OpenAPI contract, or a nested MDX document that belongs to a model object. This keeps contracts next to the prose that explains them.
Basic usage
<Attachment
model_key="logic"
object_id="logic.iomodel.api"
attachment_key="openapi"
type="openapi"
/>| Prop | Required | Purpose |
|---|---|---|
model_key | No | Model context (defaults to route) |
object_id | Yes (in specs) | Object that owns the attachment |
attachment_key | Yes | Attachment tab key to load |
type | Yes | erd, openapi, or mdx |
Supported props
Attachment does not use path or title. Use object_id + attachment_key +
type.
Attachment types
Renders an interactive API viewer from the OpenAPI attachment.
<Attachment object_id="logic.iomodel.api" attachment_key="openapi" type="openapi" />Document the contract once as an attachment and embed it wherever it is relevant. Updating the attachment updates every spec that embeds it. See Attachment component reference.
Last updated on