Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add validation for the OpenAPI specs to GitHub Actions #726

Merged
merged 3 commits into from
Nov 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/lint_test_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heads up, this is overlapping with:

'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