api icon indicating copy to clipboard operation
api copied to clipboard

feat(swagger): Add OpenAPI v3 conversion to update_swagger.sh

Open rahulsunil2 opened this issue 4 months ago • 1 comments

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:

  1. Conversion of Swagger 2.0 (OpenAPI v2) to OpenAPI v3 using api-spec-converter.
  2. Automatic creation of the output directory for OpenAPI v3 files if it doesn't exist.
  3. Improved error handling and user feedback for the conversion process.
  4. 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

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)

rahulsunil2 avatar Sep 30 '24 20:09 rahulsunil2