Skip to content

Commit

Permalink
ci: use swag v2.0.0 that now supports OpenAPI v3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
altergui committed Aug 30, 2024
1 parent a6ec29c commit 8375d8d
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/swagger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,20 @@ jobs:
cache: false
- name: Install swag
run: |
curl -L https://github.com/swaggo/swag/releases/download/v1.16.3/swag_1.16.3_Linux_amd64.tar.gz | tar -xzf -
curl -L https://github.com/swaggo/swag/releases/download/v2.0.0-rc1/swag_2.0.0-rc1_Linux_x86_64.tar.gz | tar -xzf -
- name: Run swag
run: ./swag init --parseDependency --parseDepth 1 --parseInternal --md api/docs/descriptions --overridesFile api/docs/.swaggo -g api.go -d api/,api/docs/models/ -o api/docs --ot yaml
- name: Install api-spec-converter
run: npm install -g api-spec-converter
- name: Convert the Swagger file to OAS3 format
run: api-spec-converter --from=swagger_2 --to=openapi_3 --syntax=yaml api/docs/swagger.yaml > api/docs/oas3.yaml
run: ./swag init --parseDependency --parseDepth 1 --parseInternal \
--md api/docs/descriptions \
--overridesFile api/docs/.swaggo \
-g api.go \
-d api/,api/docs/models/ \
-o api/docs --ot yaml --v3.1
- name: yq - portable yaml processor
uses: mikefarah/[email protected]
with:
cmd: |
yq '.components.schemas."api.GenericTransactionWithInfo".properties.tx = load("api/docs/models/transactions.yaml").target' \
api/docs/oas3.yaml > developer-portal/swaggers/vocdoni-api.yaml
api/docs/swagger.yaml > developer-portal/swaggers/vocdoni-api.yaml
- name: Publish Artifact
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit 8375d8d

Please sign in to comment.