OpenAPI bundler: many files to one
Runs in your browser. Nothing is uploaded.
Resolve the $refs of a multi-file OpenAPI description and get one self-contained file to publish, mock or share.
Files
openapi: 3.0.3
info:
title: Pet store
version: 1.0.0
servers:
- url: https://petstore.example.com/v1
paths:
/pets:
get:
operationId: listPets
summary: List all pets
responses:
"200":
description: The pets
content:
application/json:
schema:
type: array
items:
$ref: ./schemas/pet.yaml
/owners/{ownerId}:
get:
operationId: showOwner
summary: Info for one owner
parameters:
- name: ownerId
in: path
required: true
schema:
type: string
responses:
"200":
description: The owner
content:
application/json:
schema:
$ref: ./schemas/owner.yaml
Result
Paste, upload or load a file to start
How it works
Upload the files of a multi-file OpenAPI description, or load the entry file from a URL. The page picks the file with
an openapi field as the entry (change it in the toolbar), follows its $refs with the bundler of apigit bundle,
and shows the one self-contained file, ready to copy or download.
The sample is a pet store in three files: openapi.yaml, and schemas/pet.yaml and schemas/owner.yaml, which it refers to by relative $ref. The
end of the bundled file, where the two schemas now live:
components:
schemas:
owner:
type: object
required:
- id
properties:
id:
type: string
name:
type: string
pet:
type: object
required:
- id
- name
properties:
id:
type: integer
format: int64
name:
type: string
owner:
$ref: "#/components/schemas/owner"
The schemas that were in other files are now under components.schemas, and every reference to them points
inside the document.
What it does not do
- It does not fetch anything for uploaded files: a
$refto a URL is listed as not followed. Upload the file it names, or load the entry from its URL. - It does not validate the result; send it to the validator with "Check this".
- It does not split a file into several, and it does not rename schemas to a convention.
- It does not keep your files on a server; the last input stays in this browser until you click Clear.
This tool and APIGit
| This tool | With APIGit |
|---|---|
| Files you upload, bundled once | Split specs kept in a Git repository, with references to other files in the repository resolved for rendering |
| One output file | apigit bundle openapi.yaml -o dist/openapi.yaml in CI |
| Copy or download | A mock server from the split spec: local files it references are collected with it at publish |
| No preview of the result here | The same files rendered in the editor's Preview tab and on the published docs site |