Skip to content

Commit

Permalink
chore: add validation for the OpenAPI specs to GitHub Actions (#726)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoblersTune authored Nov 4, 2022
1 parent 7c4f93b commit 0259918
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/lint_test_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,17 @@ jobs:
timeout-minutes: 5
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: ./.github/workflows/rafiki/env-setup
- run: pnpm --filter openapi build
- run: pnpm --filter auth test
- run: pnpm --filter auth run fetch-schemas
- name: AsyncAPI extension
run: |
echo "{\"extends\":[\"spectral:oas\",\"spectral:asyncapi\"]}" >> .spectral.json
- name: Validate Open API specs
run: |
npx @stoplight/spectral-cli lint ./packages/auth/openapi/id-provider.yaml ./packages/auth/openapi/resource-server.yaml
openapi:
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion packages/auth/openapi/id-provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ paths:
type: object
properties:
access:
$ref: ./schemas.yaml#/access
$ref: ./schemas.yaml#/components/schemas/access
'404':
description: Not Found
operationId: get-grant
Expand Down
8 changes: 4 additions & 4 deletions packages/auth/openapi/resource-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ paths:
grant:
type: string
access:
$ref: ./schemas.yaml#/access
$ref: ./schemas.yaml#/components/schemas/access
key:
$ref: ./schemas.yaml#/key
$ref: ./schemas.yaml#/components/schemas/key
client_id:
type: string
description: Opaque client identifier.
Expand Down Expand Up @@ -86,11 +86,11 @@ paths:
description: The proofing method used by the client instance to bind the token to the RS request.
resource_server:
oneOf:
- $ref: ./schemas.yaml#/key
- $ref: ./schemas.yaml#/components/schemas/key
- type: string
description: 'The identification used to authenticate the resource server making this call, either by value or by reference.'
access:
$ref: ./schemas.yaml#/access
$ref: ./schemas.yaml#/components/schemas/access
required:
- access_token
- resource_server
Expand Down

0 comments on commit 0259918

Please sign in to comment.