Skip to content

Commit 4c0ebdc

Browse files
committed
Gebruik enkel specifieke Spectral OAS rules
Hiermee zorgen we ervoor dat we enkel regels aanzetten die ook relevant zijn voor de API Design Rules. Tevens zetten we die regels op error in plaats van warning, omdat ze ook verplicht zijn. Als laatste zorgt dit ervoor dat we ook netjes de publish OpenAPI design rule kunnen linken aan regels.
1 parent ee87e3a commit 4c0ebdc

3 files changed

Lines changed: 18 additions & 6 deletions

File tree

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
/testcases/paths-kebab-slashes/openapi.json
3-
96:26 warning path-keys-no-trailing-slash Path must not end with slash. paths./suffix-slash/
4-
154:37 warning path-keys-no-trailing-slash Path must not end with slash. paths./nested-slash/met-suffix/
3+
96:26 error path-keys-no-trailing-slash Path must not end with slash. paths./suffix-slash/
4+
154:37 error path-keys-no-trailing-slash Path must not end with slash. paths./nested-slash/met-suffix/
55

6-
✖ 2 problems (0 errors, 2 warnings, 0 infos, 0 hints)
6+
✖ 2 problems (2 errors, 0 warnings, 0 infos, 0 hints)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

22
/testcases/paths-kebab-zoek-uitzondering/openapi.json
3-
125:19 warning path-keys-no-trailing-slash Path must not end with slash. paths./_zoek/
3+
125:19 error path-keys-no-trailing-slash Path must not end with slash. paths./_zoek/
44

5-
✖ 1 problem (0 errors, 1 warning, 0 infos, 0 hints)
5+
✖ 1 problem (1 error, 0 warnings, 0 infos, 0 hints)

media/linter.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,23 @@
1717
# spectral lint -r .linter.yaml $OAS_URL_OR_FILE
1818
# ```
1919

20-
extends: spectral:oas
20+
extends:
21+
- ["spectral:oas", "off"] # extend spectral:oas maar zet standaard alle regels uit
2122

2223
rules:
24+
#/core/publish-openapi (deze error-rules valideren of OAS valid is)
25+
oas3-schema: error
26+
operation-operationId-unique: error
27+
path-params: error
28+
openapi-tags-uniqueness: error
29+
oas3-valid-media-example: error
30+
oas3-valid-schema-example: error
31+
oas3-server-variables: error
2332
oas3-api-servers: error
2433

34+
#/core/no-trailing-slash
35+
path-keys-no-trailing-slash: error
36+
2537
#/core/doc-openapi
2638
nlgov:openapi3:
2739
severity: error

0 commit comments

Comments
 (0)