Skip to Content
API DesignReuse Components and Split Files

Reuse Components Inside an OpenAPI Spec

Creating shared components and reusing them within an OpenAPI spec is a common best practice that aligns well with backend logic and design.

You can create reusable components under components in the navigation panel of the Form tab, and reuse them in other parts of the spec. For example, select Schema under components to define an object once, field by field.

Editing the Order schema component in the form editor

Split Components Into Multiple Files

In more advanced scenarios, you may have multiple API specs in a repository that need to share component definitions. We fully support this approach.

You can split your specification into multiple component files and reference them from other files in the same repository. When you pick a reference in the form editor, the dropdown lists local components of the current spec and external ones from other spec files in the repository, including files you have created but not committed yet.

Last updated on