A powerful tool to fix OpenAPI spec to ensure compatibility with various code generators and tools
openapi-fixer
is a Go-based tool designed to help developers automatically apply fixups to OpenAPI specification files. It provides tooling to modify OpenAPI 3.0 specification file to ensure it's compatibility with various code generators and tools while maintaining the integrity of the API specification.
go install github.com/zguydev/openapi-fixer@latest
//go:generate go run github.com/zguydev/openapi-fixer openapi.yaml fixed.openapi.yaml --fixups ./fixups/ --config .openapi-fixer.yaml
- Helper package for comon repeated schema validation and access patterns
- Feature to use YAML config files for mappings and targets instead of hardcoding to fixups
- Generic fixup types
- Logging to track fixups apply
- More descriptive error messages, include context in errors (to tell which schema/property failed)
- Fixup chaining to allow them depend on each other
- Fixups progress reporting
- Improved type safety - enums for common types
- Dry run mode to report what would change
- Feature to check what parts of spec are wrong
- Fixups dir generator via CLI
Explore ready-to-use examples:
Example Name | Description | Path |
---|---|---|
🤖 OpenAI Example | Fixups for the OpenAI API schema on example of POST /chat/completions endpoint |
examples/OpenAI |
This project is licensed under the terms of the Apache License 2.0. See the LICENSE file for details.