Skip to content

Commit

Permalink
Add openapi linter + openapi.json (#49)
Browse files Browse the repository at this point in the history
Co-authored-by: GitHub Actions <[email protected]>
  • Loading branch information
waynehamadi and GitHub Actions committed Aug 28, 2023
1 parent 074565d commit 2bb0490
Show file tree
Hide file tree
Showing 5 changed files with 1,197 additions and 109 deletions.
22 changes: 21 additions & 1 deletion .github/workflows/update-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,27 @@ jobs:
run: |
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git commit -am "Update endpoint docs"
git commit -am "Update endpoint docs" || echo "No changes to commit"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install swagger-cli
run: |
npm install -g swagger-cli
npm install -g openapi-format
- name: Lint and Convert openapi.yml to openapi.json and commit changes
run: |

This comment has been minimized.

Copy link
@hansmoritzhafen

This comment has been minimized.

Copy link
@jzanecook

jzanecook Oct 10, 2023

Collaborator

Very interesting comment, Hans. Unfortunately I will not be taking this into consideration.

cd ..
npx openapi-format schemas/openapi.yml --output schemas/openapi.yml
swagger-cli bundle -r schemas/openapi.yml -o schemas/openapi.json -t json
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git add schemas/openapi.yml
git add schemas/openapi.json
git commit -am "Lint OpenAPI schemas" || echo "No changes to commit"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 4 additions & 0 deletions .postman/api
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
apis[] = {"apiId":"63f5e342-f43f-45fa-9a50-87934ccddcab"}
configVersion = 1.0.0
type = api
22 changes: 22 additions & 0 deletions .postman/api_63f5e342-f43f-45fa-9a50-87934ccddcab
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY
configVersion = 1.0.0
type = apiEntityData

[config]
id = 63f5e342-f43f-45fa-9a50-87934ccddcab

[config.relations]

[config.relations.collections]
rootDirectory = postman/collections

[config.relations.collections.metaData]

[config.relations.apiDefinition]
rootDirectory = schemas
files[] = {"path":"openapi.json","metaData":{}}
files[] = {"path":"openapi.yml","metaData":{}}

[config.relations.apiDefinition.metaData]
type = openapi:3
rootFiles[] = openapi.yml
Loading

0 comments on commit 2bb0490

Please sign in to comment.