Skip to content

Commit cff02ec

Browse files
committed
ci(model-server-openapi): lint the specification with spectral in GHA
Encourages the well-known Zalando RESTful OpenAPI guidelines.
1 parent 3bf7b08 commit cff02ec

File tree

5 files changed

+4050
-195
lines changed

5 files changed

+4050
-195
lines changed

.github/workflows/linting.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ jobs:
2020
- uses: actions/setup-python@v5
2121
- uses: pre-commit/[email protected]
2222

23+
openapi-linting:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- name: Clone repo
27+
uses: actions/checkout@v4
28+
- uses: stoplightio/[email protected]
29+
with:
30+
file_glob: 'model-server-openapi/specifications/model-server-*.yaml'
31+
continue-on-error: true
32+
2333
openapi-breaking-changes:
2434
runs-on: ubuntu-latest
2535
permissions:

.spectral.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
extends:
2+
- https://raw.githubusercontent.com/baloise-incubator/spectral-ruleset/5b2386ffa4d0ab4ccef0e1fc87f3d00fefc81eea/zalando.yml
3+
- "spectral:oas"
4+
rules:
5+
# We don't need an API info for internal use
6+
must-have-info-contact-email: false
7+
must-have-info-contact-name: false
8+
must-have-info-contact-url: false
9+
must-have-info-x-api-id: false
10+
must-provide-api-audience: false
11+
12+
# The rule is based on an outdated problem specification
13+
must-use-valid-problem-json-schema: false
14+
15+
# We would lose enum support from openapi-generator
16+
should-use-x-extensible-enum: false

commitlint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ module.exports = {
1515
"model-client",
1616
"model-datastructure",
1717
"model-server",
18+
"model-server-openapi",
1819
"modelql",
1920
"mps-model-adapters",
2021
"mps-model-server",

0 commit comments

Comments
 (0)