stefna / open-api-bundler
Cli tool to help inline/bundle open api specifications
1.6.1
2024-11-28 14:58 UTC
Requires
- php: ^8.2
- circli/console: ^2.0.0
- psr/log: ^1.1 || ^2.0 || ^3.0
- stefna/json-pointer: ^2.6
Requires (Dev)
- phpstan/phpstan: ^1.10
- starburst/contract: ^1.0
- stefna/codestyle: ^1.12.1
- stefna/di: ^1.0
README
Provides a cli command to help bundle up OpenAPI specifications in to one file by resolving all the external references in the schema
Installation
Requires PHP 8.2+
composer require stefna/open-api-bundler
Usage
The bundler support both json files and yaml files.
Example files
You can find examples of specifications in the examples folder
Each example should have these files:
schema.json
input schemaschema.dist.json
bundled outputschema.dist.min,json
bundled minified output
Basic
> bundle basic/schema.json
{
... bundle specification
}
Output folder specified
> bundle basic/schema.json dist
Bundling: api.json
Writing output to: dist/schema.json
Output file specified
> bundle basic/schema.json basic/schema.dist.json
Bundling: api.json
Writing output to: basic/schema.dist.json
Bundle compression
> bundle basic/schema.json --compress
{... specification without whitespace ...}
Framework integrations
Starburst
To add this command to starburst-cli just add OpenApiBundleBootstrap
to your bootstrap config.
When using this with starburst you can add BundleConfig
to your di to change the default values for the bundle
command
Contribute
We are always happy to receive bug/security reports and bug/security fixes
License
The MIT License (MIT). Please see License File for more information.