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

NPA-3899 Validate Consent Example #126

Closed
wants to merge 9 commits into from
Closed
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
25 changes: 25 additions & 0 deletions .github/workflows/schema-checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Schema Checks

on: pull_request

jobs:
schema-validate-examples:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '22'

- name: Install dependencies
run: npm install -g

- name: Run Schema Validation
run: npm run validate-example
env:
EXAMPLE_PATH: "specification/examples/responses/GET_Consent/adults-consenting.yaml"
SCHEMA_PATH: "specification/validated-relationships-service-api.yaml"
SCHEMA_OBJECT: "#/components/schemas/Consent"
162 changes: 161 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"scripts": {
"lint": "node_modules/.bin/openapi-generator-cli validate -i specification/validated-relationships-service-api.yaml",
"publish": "./node_modules/.bin/openapi-generator-cli generate -i specification/validated-relationships-service-api.yaml --generator-key v3.0 -g openapi -o build && rm openapitools.json && mv build/openapi.json build/validated-relationships-service-api.json",
"check-licenses": "node_modules/.bin/license-checker --failOn GPL --failOn LGPL"
"check-licenses": "node_modules/.bin/license-checker --failOn GPL --failOn LGPL",
"validate-example" :"schema validate -f $EXAMPLE_PATH -s $SCHEMA_PATH -o $SCHEMA_OBJECT"
},
"author": "NHS Digital",
"license": "MIT",
Expand All @@ -14,6 +15,7 @@
"@openapitools/openapi-generator-cli": "^2.15.3",
"apigeetool": "^0.16.4",
"license-checker": "^25.0.1",
"minimist": "^1.2.2"
"minimist": "^1.2.2",
"yaml-schema-validator": "^1.2.3"
}
}
Loading