-
Notifications
You must be signed in to change notification settings - Fork 516
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade codegen tools in scripts/generate-open-api-spec
and publish Swagger 2.0 and OpenAPI 3.0 specs
#2246
Upgrade codegen tools in scripts/generate-open-api-spec
and publish Swagger 2.0 and OpenAPI 3.0 specs
#2246
Conversation
Signed-off-by: ff137 <[email protected]>
Signed-off-by: ff137 <[email protected]>
…6.6.0`, from previous `swaggerapi/swagger-codegen-cli:2.4.32` Signed-off-by: ff137 <[email protected]>
Signed-off-by: ff137 <[email protected]>
Signed-off-by: ff137 <[email protected]>
Signed-off-by: ff137 <[email protected]>
Signed-off-by: ff137 <[email protected]>
Signed-off-by: ff137 <[email protected]>
Signed-off-by: ff137 <[email protected]>
Signed-off-by: ff137 <[email protected]>
Signed-off-by: ff137 <[email protected]>
Signed-off-by: ff137 <[email protected]>
Signed-off-by: ff137 <[email protected]>
Signed-off-by: ff137 <[email protected]>
Signed-off-by: ff137 <[email protected]>
Signed-off-by: ff137 <[email protected]>
Signed-off-by: ff137 <[email protected]>
Signed-off-by: ff137 <[email protected]>
…th swagger and openapi Signed-off-by: ff137 <[email protected]>
Signed-off-by: ff137 <[email protected]>
…pi-spec`) Signed-off-by: ff137 <[email protected]>
d4dc711
to
7b82ce8
Compare
Signed-off-by: ff137 <[email protected]>
scripts/generate-open-api-spec
and publish Swagger 2.0 and OpenAPi 3.0 specsscripts/generate-open-api-spec
and publish Swagger 2.0 and OpenAPI 3.0 specs
@swcurran I was thinking it may be worthwhile to add an OpenAPI Spec Generation to the CI workflow. Something like: name: OpenAPI Spec Check
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup environment
run: |
# setup necessary environment
- name: Generate OpenAPI specs
run: |
./scripts/generate-open-api-spec
- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git commit -m "Update Swagger/OpenAPI specs" -a What do you think? |
Kudos, SonarCloud Quality Gate passed! |
Nice work — looks good. There sure are a lot of errors generated!!! I’m assuming that is expected/OK, given that things are working. @jcourt562 — any thoughts on the idea of a GHA to generate the openapi JSON? |
@swcurran Thanks! I would say the warnings are low priority to fix, but always worth it in the long run. It's mainly:
The UsingOpenAPI.md does say (2 years ago) I do have a script for patching an openapi.yml with a mapping of operation-ids. Maybe that feels like a more maintainable solution than tagging? Because then you can manage all operation id's in one file. Let me know and I can add it. As for all the: |
Now is as good a time as any to upgrade the codegen tools in
scripts/generate-open-api-spec
to use the latestswaggerapi/swagger-codegen-cli
release (it was ~3 years out of date).Additionally, I added the latest
openapitools/openapi-generator-cli
, so that the spec generation now provides both a Swagger 2.0 spec, and an OpenApi 3.0 spec. This way users don't need to manually upgrade the spec themselves.Previously the Swagger 2.0 spec was simply called
openapi.json
. This is now renamedswagger.json
, with the 3.0 compatible spec in its place.Worth noting that the spec validation still only throws warnings that can be ignored:
swagger
spec validation only complains about some missing operationId's (and 'host' not defined);open-api
spec validation only complains aboutexample
fields being unexpected, and a single case ofattribute tags.tagsexternalDocs.url is missing
.Also, I updated the
UsingOpenAPI.md
file to reflect these changes, with some minor neatening up included.Review can be validated by running
scripts/generate-open-api-spec
.Discussion re further edits is welcome.