Add OpenAPI specification with workflow to update them upon PR #1
Workflow file for this run
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
# This workflow will update the oh.yaml OpenAPI specification | |
# For more information see: https://swagger.io/ | |
name: OpenAPI spec generation | |
on: [push, pull_request] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v1 | |
with: | |
java-version: 11 | |
- name: Build with Maven | |
run: mvn -B package --file pom.xml | |
- name: Run | |
run: java -cp "target/openhospital-api-0.1.0.jar:rsc/:static/" org.springframework.boot.loader.JarLauncher | |
- name: Get json | |
run: curl -o openapi/oh.json http://localhost:8080/v3/api-docs | |
- name: Convert to json to yaml | |
uses: mikefarah/yq@master | |
with: | |
cmd: yq -p openapi/oh.json -o yaml openapi/oh.yaml | |
- name: Update PR | |
- uses: gr2m/create-or-update-pull-request-action@v1 | |