VOOZH about

URL: https://thenewstack.io/openapi-how-to-handle-file-management/

⇱ OpenAPI: How to Handle File Management - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2025-04-08 09:00:19
OpenAPI: How to Handle File Management
sponsor-boomi,sponsored-topic,
API Management

OpenAPI: How to Handle File Management

As more organizations adopt OpenAPI, it's good to get up to speed on managing the files you create and consume.
Apr 8th, 2025 9:00am by Lorna Mitchell
👁 Featued image for: OpenAPI: How to Handle File Management
Image by Nils Schirmer from Unsplash.
OpenAPI is a human- and machine-friendly API description format for HTTP APIs, and is seeing increased adoption across the software industry. As organizations work on the API experience for themselves as producers, and as consumers of an increasing number of third-party APIs, it’s key to have a good process for working with OpenAPI files.

Design-First APIs

Design-first is emerging as an efficient and effective approach to building APIs. In design-first APIs, the OpenAPI description is updated to describe the proposed API changes. Documentation and mock servers may also be produced at this stage, while feedback is collected from stakeholders. Once the changes are approved and accepted, the API is implemented. Working in a design-first approach means that changes to API design are easy to achieve at an early stage, where only the OpenAPI description needs to be updated and no code has been written yet. The downside is that many organizations find the OpenAPI format difficult to work with; often the API description is a single file and it may run to hundreds of thousands of lines of YAML or JSON. While having a good editor with OpenAPI support really helps, the structure of the OpenAPI description itself can also make a big difference to your API authoring experience.

Use OpenAPI $ref Syntax

One reason the files get so long is that the OpenAPI format is, by necessity, verbose and because the same elements are often repeated in multiple places. For example, a newsletter microservice probably has an email field and a list of subscriptions that are the same in more than one endpoint. OpenAPI makes this repetition easy with its `$ref` syntax. Define the field once in the `components` section of the OpenAPI description and then refer to it with `$ref` in every location where it is needed. Here’s a snippet of the newsletter microservice example: Using `$ref` not only makes the files more manageable but also encourages consistency by using the same schema definitions throughout an API description. Consistency is key for API experience and so the `$ref` syntax serves both producer and consumer when it is used. The `$ref` syntax can also refer to content in other files, which gives users more ways to make their OpenAPI files easier to work with.

Separate Components

Since OpenAPI 3.1 (released February 2021), an OpenAPI description can be valid with any one or more of `paths`, `webhooks` and `components` declared. What this means in practical terms is that if your API is purely webhooks or you have a single set of components that are used by multiple APIs, you can publish those API descriptions without needing an empty `paths: {}` object. Especially for microservices architectures, common components used to give a consistent experience across modules is a popular and helpful pattern. For example, for a shopping application that has separate “account” and “order” services, it might make sense to separate the components into one OpenAPI file, and refer to it from the individual API descriptions for the separate services. The directory structure would look something like this:
├── accounts.openapi.yaml
├── components.openapi.yaml
└── orders.openapi.yaml
If there’s a schema `customer_name` in the `components.openapi.yaml` OpenAPI file, the other API descriptions can refer to it with syntax like the example below:
$ref: 'components.openapi.yaml#/components/schemas/customer_name'
Each OpenAPI file is smaller, making it more manageable to edit and review changes. When you are ready to publish either the Account or Order API, you can bundle the file using a tool like Vacuum or Redocly CLI to create a single OpenAPI file that can be used to pass to another tool such as your documentation platform or API gateway.

Radical OpenAPI File Structures

Some organizations split up their OpenAPI files more thoroughly, holding one file per operation and another for each element in the `components` section. With the `$ref` syntax, really anything is possible! At its most radical, the newsletter example from earlier ends up looking something like this: Whether you design and build your API structure this way, or use a tool like Redocly CLI’s `split` command to restructure an existing API description, working with many smaller files has advantages:
  • Each file is small enough to easily open and view
  • You can view multiple files at once without losing your place in a long file.
  • Proposed changes are much easier to review because you can see which areas are affected.
One major downside is that each file is “just” YAML, so there’s no OpenAPI file validation available when you’re working on the individual elements. Depending on your team, that might be an acceptable trade-off though, and the usual API linting and governance steps can be applied in CI to the bundled version of the API description.

What’s Your Goldilocks Granularity?

There is no “right” answer for how to structure your OpenAPI files. Some teams are very happy with a single file and see no problem to solve. Others are fully committed to a very granular approach and wouldn’t consider changing. The right answer for your team might lie somewhere between the extremes, but by being aware of the options and open to change, you can find an approach that fits your needs and leads to more efficient and happier API experiences.
Boomi powers the future of business with intelligent integration and automation. As a category-leading, global SaaS company, Boomi celebrates more than 20,000 customers and 800 partners who use Boomi to connect their applications, data, and people. For more information, visit boomi.com.
Learn More
TRENDING STORIES
Lorna Mitchell is based in Yorkshire, U.K.; she is a technology leader and developer experience expert who is passionate about APIs and developer tools. Lorna serves on the Technical Steering Committee for the OpenAPI specification, is on the board of...
Read more from Lorna Mitchell
SHARE THIS STORY
TRENDING STORIES
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
👁 Image
To benefit from AI, effective API management is crucial. Our guide covers 5 key points to make your business AI-ready.