docs: reconcile object schemas with backend and LDAP #24
This file contains hidden or 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
| name: Lint API specs | |
| on: | |
| push: | |
| branches: [master] | |
| paths: | |
| - 'reference/**' | |
| - '.spectral.mjs' | |
| - '.stoplight/**' | |
| - '.github/workflows/lint.yml' | |
| pull_request: | |
| paths: | |
| - 'reference/**' | |
| - '.spectral.mjs' | |
| - '.stoplight/**' | |
| - '.github/workflows/lint.yml' | |
| jobs: | |
| openapi: | |
| name: Spectral (OpenAPI) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: '20' | |
| - name: Install Spectral | |
| run: npm install -g @stoplight/spectral-cli@^6 | |
| - name: Lint OpenAPI specs | |
| run: | | |
| # The AsyncAPI stream spec is linted in the asyncapi job. | |
| mapfile -t files < <(find reference -maxdepth 1 -name '*.yaml' \ | |
| ! -name 'ldap-subscriber-api-stream.yaml' | sort) | |
| if [ ${#files[@]} -eq 0 ]; then | |
| echo "No OpenAPI YAML files found under reference/" | |
| exit 1 | |
| fi | |
| printf 'Linting:\n' | |
| printf ' %s\n' "${files[@]}" | |
| spectral lint --ruleset .spectral.mjs --fail-severity=error "${files[@]}" | |
| asyncapi: | |
| name: AsyncAPI | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| - uses: actions/setup-node@v5 | |
| with: | |
| node-version: '20' | |
| - name: Validate AsyncAPI spec | |
| run: npx -y @asyncapi/cli@latest validate reference/ldap-subscriber-api-stream.yaml |