api
api copied to clipboard
feat(swagger): Add OpenAPI v3 conversion to update_swagger.sh
This PR adds functionality to convert Swagger 2.0 (OpenAPI v2) to OpenAPI v3 using api-spec-converter in the update_swagger.sh script.
Description
This PR enhances the update_swagger.sh
script by adding the following features:
- Conversion of Swagger 2.0 (OpenAPI v2) to OpenAPI v3 using api-spec-converter.
- Automatic creation of the output directory for OpenAPI v3 files if it doesn't exist.
- Improved error handling and user feedback for the conversion process.
- Instructions for installing api-spec-converter if it's not found on the system.
These changes improve the API documentation workflow by providing up-to-date OpenAPI v3 specifications alongside the existing Swagger 2.0 documentation.
References
- OpenAPI Initiative - Information about OpenAPI Specification
- api-spec-converter - Tool used for converting between API specification formats
Review Checklist
- [ ] I have clicked on "allow edits by maintainers".
- [ ] I have added documentation for new/changed functionality in this PR or in a PR to openfga.dev [Provide a link to any relevant PRs in the references section above]
- [ ] The correct base branch is being used, if not
main
- [ ] I have added tests to validate that the change in functionality is working as expected
- [ ] I have tested the script with both existing and non-existing output directories
- [ ] I have verified that the script handles errors gracefully (e.g., when api-spec-converter is not installed)