---
title: "Discussion on \"How to organize a large OpenAPI spec: multi-file structure, $ref rules, and CI checks\" | Hashnode"
description: "Discussion on \"How to organize a large OpenAPI spec: multi-file structure, $ref rules, and CI checks\". A 4,000-line YAML file is unmaintainable, but splitting a spec wrong creates a web of relative refs that no editor or bundler can resolve. Here is a folder layout that scales past 200 operations, the $ref conventions that keep it sane, and the CI checks that keep it honest."
url: "https://hashnode.com/posts/organize-large-openapi-spec-multiple-files/6aca081d46cca2a7ecaaaf73"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to organize a large OpenAPI spec: multi-file structure, $ref rules, and CI checks](https://blogs.powerduck.com/organize-large-openapi-spec-multiple-files?utm_source=hashnode&utm_medium=feed)

A 4,000-line YAML file is unmaintainable, but splitting a spec wrong creates a web of relative refs that no editor or bundler can resolve. Here is a folder layout that scales past 200 operations, the $ref conventions that keep it sane, and the CI checks that keep it honest.

Aug 15 · 6 min read · blogs.powerduck.com  
Read the article

-   [#openapi](https://hashnode.com/tag/openapi)
-   [#workflow](https://hashnode.com/tag/workflow)

## Written by

[Powerduck](https://hashnode.com/@powerduck)

@powerduck · hon

  
[View profile](https://hashnode.com/@powerduck)

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
