@@ -3,20 +3,20 @@ content_type: tool
33tags : [adr, api]
44---
55
6- # ADR Linter
6+ # ADR Checker
77
8- De ADR Linter controleert of een OpenAPI Specificatie compliant is met de API
9- Design Rules. De linter is gebaseerd op het Open Source project
10- [ Spectral ] ( https://github.com/stoplightio/spectral ) .
8+ De ADR Checker controleert of een OpenAPI Specificatie compliant is met de API
9+ Design Rules. De checker is gebaseerd op de
10+ [ DON Checker ] ( https://github.com/developer-overheid-nl/don-checker ) .
1111
1212## Browser
1313
14- Een OpenAPI Specificatie kan online getest worden via onze online OAS Checker:
15- [ https://developer-overheid-nl.github.io/oas -checker ] ( https://developer-overheid-nl.github.io/oas -checker )
14+ Een OpenAPI Specificatie kan online getest worden via onze online ADR Checker:
15+ [ https://developer-overheid-nl.github.io/don -checker/#/adr ] ( https://developer-overheid-nl.github.io/don -checker/#/adr )
1616
1717### Resultaten interpreteren
1818
19- De OAS Checker toont drie soorten meldingen:
19+ De ADR Checker toont drie soorten meldingen:
2020
2121| Type | Betekenis |
2222| ------- | -------------------------------------------------------------------------- |
@@ -26,67 +26,70 @@ De OAS Checker toont drie soorten meldingen:
2626
2727## CLI
2828
29- Nadat je Spectral geïnstalleerd hebt, kun je een OAS via de commandline op de
30- volgende manier valideren:
29+ Je kunt een OAS via de commandline op de volgende manier valideren:
3130
32- ``` bash
33- $ npm install -g @stoplight/spectral-cli
34- $ spectral lint -r https://static.developer.overheid.nl/adr/ruleset.yaml $OAS_URL_OR_FILE
35- ```
36-
37- ## IDE
38-
39- Sommige IDEs ondersteunen Spectral via extensies of plugins.
40-
41- ### Visual Studio Code
42-
43- Hieronder staat beschreven hoe je de ADR Linter kunt gebruiken met
44- [ de officiele Spectral extensie voor Visual Studio Code] ( https://github.com/stoplightio/vscode-spectral ) :
31+ ``` sh
32+ # From a local file (ADR, default version)
33+ npx @developer-overheid-nl/don-checker@latest validate --standard adr --input ./openapi.json
4534
46- ``` bash
47- # Install the extension from the vscode marketplace
48- $ code --install-extension stoplight.spectral
49-
50- # Download the ruleset to your project home
51- $ curl -L https://static.developer.overheid.nl/adr/ruleset.yaml > .spectral.yml
52-
53- # Run the IDE
54- $ code
55- ```
56-
57- ### IntelliJ IDEA
35+ # Pin a specific version
36+ npx @developer-overheid-nl/don-checker@latest validate --standard adr --version 2.1.0 --input ./openapi.json
5837
59- Voor IntelliJ-based IDEs (IntelliJ IDEA, WebStorm, etc.) is er de
60- [ Spectral plugin] ( https://plugins.jetbrains.com/plugin/18520-spectral ) . Na
61- installatie kun je een ` .spectral.yaml ` bestand in je project root plaatsen met
62- de volgende inhoud:
38+ # From an external file (ADR, default version)
39+ npx @developer-overheid-nl/don-checker@latest validate --standard adr \
40+ --input https://api.developer.overheid.nl/api-register/v1/openapi.json
6341
64- ``` yaml
65- extends :
66- - https://static.developer.overheid.nl/adr/ruleset.yaml
42+ # From stdin
43+ cat openapi.json | npx @developer-overheid-nl/don-checker@latest validate --standard adr
6744```
6845
6946## Docker
7047
7148``` bash
72- $ docker run --rm --entrypoint=sh \
73- -v $(pwd)/api:/locale stoplight/spectral \
74- -c "spectral lint -r https://static .developer.overheid.nl/adr/ruleset.yaml $OAS_URL_OR_FILE"
49+ docker run --rm node:24-alpine \
50+ npx @developer-overheid-nl/don-checker@latest validate --standard adr \
51+ --input https://api .developer.overheid.nl/api-register/v1/openapi.json
7552```
7653
77- ## GitLab
78-
79- ``` yaml
80- spectral-lint :
81- image : node:20
82- stage : spectral_lint
83- script :
84- - npm install -g @stoplight/spectral-cli
85- - curl -L https://static.developer.overheid.nl/adr/ruleset.yaml >
86- .spectral.yml
87- - spectral lint -r .spectral.yml $OAS_URL_OR_FILE
88- rules :
89- - if : ' $CI_PIPELINE_SOURCE == "merge_request_event"'
90- when : always
91- - when : manual
92- ` ` `
54+ ## Git workflows
55+
56+ import Tabs from "@theme/Tabs "; import TabItem from "@theme/TabItem ";
57+
58+ <Tabs groupId =" git-workflow " >
59+ <TabItem value =" gitlab " label =" GitLab CI " >
60+ ```yaml title=".gitlab-ci.yml"
61+ adr-check:
62+ image: node:24
63+ stage: adr_check
64+ script:
65+ - npx @developer-overheid-nl/don-checker@latest validate --standard adr --input $OAS_URL_OR_FILE
66+ rules:
67+ - if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
68+ when: always
69+ - when: manual
70+ ```
71+ </TabItem >
72+ <TabItem value =" github " label =" GitHub Actions " default >
73+ ``` yaml title=".github/workflows/adr-check.yml"
74+ name : ADR check
75+ on :
76+ pull_request :
77+ workflow_dispatch :
78+ jobs :
79+ adr-check :
80+ runs-on : ubuntu-latest
81+ steps :
82+ - uses : actions/checkout@v4
83+ - uses : actions/setup-node@v4
84+ with :
85+ node-version : 24
86+ - name : Valideer OAS tegen de API Design Rules
87+ run : |
88+ npx @developer-overheid-nl/don-checker@latest validate \
89+ --standard adr --input ${{ env.OAS_URL_OR_FILE }}
90+ env :
91+ OAS_URL_OR_FILE : ./openapi.json
92+ ` ` `
93+ </TabItem>
94+
95+ </Tabs>
0 commit comments