From 3ddd32f4b866caa5186c2dc69f9637a85b50b188 Mon Sep 17 00:00:00 2001 From: George Adams Date: Tue, 24 Nov 2020 17:34:18 +0000 Subject: [PATCH 1/3] add speccy openapi linting --- .github/workflows/build.yml | 8 +++++++- speccy.yaml | 14 ++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 speccy.yaml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 125a78ba..a2a46f1f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: java-package: jdk architecture: x64 - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Build app run: ./mvnw --batch-mode clean install jacoco:report jacoco:report-aggregate @@ -30,6 +30,12 @@ jobs: ../mvnw --batch-mode org.openapitools:openapi-generator-maven-plugin:4.3.0:generate \ -Dopenapi.generator.maven.plugin.inputSpec=META-INF/quarkus-generated-openapi-doc.YAML + - name: Parse openapi doc + run: | + npm i -g speccy + sed -E 's/"([0-9]+)"/\1/g' adoptopenjdk-api-v3-frontend/META-INF/quarkus-generated-openapi-doc.YAML > openapi.yml + speccy lint openapi.yml + - name: Zip Javascript client run: zip -r javascript-client.zip adoptopenjdk-api-v3-frontend/target/generated-sources/openapi diff --git a/speccy.yaml b/speccy.yaml new file mode 100644 index 00000000..2435628b --- /dev/null +++ b/speccy.yaml @@ -0,0 +1,14 @@ +# Output a lot of information about what is happening (wont work if you have quiet on) +# Default stdout = 1 +verbose: 2 +# Rules specific to the lint command +lint: + # rules files to load + rules: + - strict + # rules to skip + skip: + - info-contact + - operation-operationId + - short-summary + - tag-description \ No newline at end of file From e4ea574777e896fc14d6fa69813dfa7cbc3090fe Mon Sep 17 00:00:00 2001 From: George Adams Date: Tue, 24 Nov 2020 17:36:24 +0000 Subject: [PATCH 2/3] Update build.yml --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a2a46f1f..3472b169 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,6 +33,7 @@ jobs: - name: Parse openapi doc run: | npm i -g speccy + # default values cannot be strings even though ours are sed -E 's/"([0-9]+)"/\1/g' adoptopenjdk-api-v3-frontend/META-INF/quarkus-generated-openapi-doc.YAML > openapi.yml speccy lint openapi.yml From d208d617d1badceb32b593c6fcd1a0f1d1e12abb Mon Sep 17 00:00:00 2001 From: George Adams Date: Tue, 24 Nov 2020 21:25:35 +0000 Subject: [PATCH 3/3] Update build.yml --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3472b169..864d22af 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,6 +13,10 @@ jobs: java-version: '11.0.7' java-package: jdk architecture: x64 + + - uses: actions/setup-node@v1 + with: + node-version: '14' - uses: actions/checkout@v2