Skip to main content

Tool to trim OpenAPI YAML file to include only desired paths and components.

Project description

OpenAPI Trimmer

⚡ Python / Bash CLI Tool to Trim OpenAPI Paths / Endpoints ⚡

OpenAPI Trimmer is a lightweight tool designed to trim down your OpenAPI files to include only the endpoints and data transfer objects (DTOs) you care about. This helps in managing large OpenAPI files by focusing only on the necessary parts for specific tasks.

Usage

Example usage to make Open API file only for /v1/quotes and /v1/users APIs, removing all others and also removing some DTOs:

openapi-trimmer -i openapi.yaml \
  -p /v1/quotes,/v1/users \
  -ec CompanyConfigDto,UpdateCompanyConfigDto

The output will be stored in openapi-trimmer.yaml

At the end validate with:

swagger-cli validate ./openapi-trimmer.yaml

Install from PyPi

To install check the package on PyPi:

https://pypi.org/project/openapi-trimmer/

pip install openapi-trimmer

Credits

This tool was inspired from the OpenAPI Endpoint Trimmer JavaScript tool openapi-endpoint-trimmer by andenacitelli.

Support

If you'd like to support me, you can support me with the "Sponsor" options on the right. Thank you for your support!

Contributing

I highly encourage contributions! Create issues and/or PRs for any bugs or features you'd like to see.

License

This project is licensed under the MIT license. This basically means you can use it for any purpose, commercially or not, but I have zero liability.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

openapi_trimmer-0.1.4.tar.gz (4.4 kB view hashes)

Uploaded Source

Built Distribution

openapi_trimmer-0.1.4-py3-none-any.whl (5.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page