-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: use swag v2.0.0 that now supports OpenAPI v3.1
- Loading branch information
Showing
1 changed file
with
8 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|