Skip to content

Starting point for documenting an API with OpenAPI and displaying the documentation using Framna Docs. Uses sources files that are bundled to a single spec.

Notifications You must be signed in to change notification settings

shapehq/starter-openapi-bundled

Repository files navigation

🚀 starter-openapi-bundled

This repository contains a starting point for documenting an API with OpenAPI and displaying the documentation using Framna Docs.

The OpenAPI specification is split across multiple files in the src/ directory and bundled into a single file for distribution.

Read more about this workflow in the Framna Docs wiki: Working with Large Specs.

📦 Contents of the repository

The repository contains the following files and folders.

File/Folder Description
src/ Source directory containing the split OpenAPI specification files.
src/openapi.yml The main OpenAPI specification file that references other components.
src/paths/ Directory containing individual path/endpoint definitions.
src/schemas/ Directory containing reusable schema definitions.
openapi-bundle.yml The bundled OpenAPI specification generated from the src files.
bundle.sh Script to bundle the split OpenAPI files into a single specification.
lint.sh Script to lint the OpenAPI specification.
.framna-docs.yml A configuration file that specifies the project name and icon to show on Framna Docs. For more information, see the documentation of Framna Docs.
icon.png The icon displayed on Framna Docs.
.spectral.yml A configuration file for the open-source Spectral linter that can be used to validate the OpenAPI specification.
.github/workflows/lint.yml A workflow that lints the OpenAPI specification in pull requests using the Spectral linter.
.githooks/ Directory containing Git hooks for the repository.
.githooks/pre-push A pre-push hook that automatically runs the bundle script and ensures the bundled file is up to date before pushing.

🪝 Setting up Git Hooks

To enable the pre-push hook that automatically bundles the OpenAPI spec before pushing:

git config core.hooksPath .githooks

This ensures the openapi-bundle.yml file is always up to date when pushing changes.

🛠️ Working with the bundled structure

To modify the API specification, edit files in the src/ directory:

After making changes, run bundle.sh to generate the bundled openapi-bundle.yml file.

About

Starting point for documenting an API with OpenAPI and displaying the documentation using Framna Docs. Uses sources files that are bundled to a single spec.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages