Skip to content

Update JSON Schema to be v1.0 compliant #1600

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

Merged
merged 29 commits into from
May 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
cfde575
Update JSON Schema to be v1.0 compliant
VGirol Dec 22, 2021
f2cf5cb
Update schema to be more reusable
VGirol Jan 18, 2022
a365699
Add schema to validate a request that update a resource or a relation…
VGirol Jan 24, 2022
ef83636
Change naming convention and folder structure to be more consistent
VGirol Feb 8, 2022
4132626
Enhance reusability
VGirol Feb 15, 2022
8597530
Lint test files
VGirol Feb 15, 2022
fdc9720
Fix typo
VGirol May 10, 2022
49ea5cd
Update JSON Schema to be v1.0 compliant
VGirol Dec 22, 2021
5d5f369
Update schema to be more reusable
VGirol Jan 18, 2022
3b10eaa
Add schema to validate a request that update a resource or a relation…
VGirol Jan 24, 2022
dc1f3cc
Change naming convention and folder structure to be more consistent
VGirol Feb 8, 2022
1bec0a0
Change all title to more neutral text.
VGirol Aug 12, 2022
967e17c
Add script to valide JSON schema against all test files and update sc…
VGirol Aug 14, 2022
3b954d4
Add documentation on how to run the tests for the JSON Schemas
VGirol Aug 16, 2022
46427f7
Update validation script of JSON Schema so that validation is also do…
VGirol Aug 16, 2022
cc50fdd
script linting
VGirol Aug 16, 2022
e955058
Revert "script linting"
VGirol Aug 16, 2022
12cdaa8
Script linting
VGirol Aug 16, 2022
abdd582
Enhance script output
VGirol Aug 18, 2022
0b97835
Enhance readability
VGirol Aug 18, 2022
424a84b
Add -f and -v options to test script
VGirol Aug 18, 2022
3291313
Fix typo
VGirol Aug 18, 2022
cdd7b4b
Add test-schema to CI
VGirol Aug 22, 2022
0cf8847
Fix typo in bash command to run script
VGirol Oct 21, 2022
f1a98bf
Change trigger for the "Schema validation test" workflow
VGirol Oct 21, 2022
fae1d42
Allow for parallel relationships in JSON Schema
VGirol Nov 1, 2022
31b120a
Bump ajv version
VGirol Feb 10, 2023
f3a8aa7
Update to latest version of json-schema
VGirol Sep 22, 2023
5555fa9
Remove node_modules
VGirol Nov 13, 2023
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
27 changes: 27 additions & 0 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Schema validation tests

on:
push:
branches: [ gh-pages, schema-1.0 ]
pull_request:
branches: [ gh-pages ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm ci
- name: Test schemas
run: npm run test-schema
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,7 @@ Gemfile.lock
/bin
/b
.rbx

# Ignore the node_modules directory

/node_modules
25 changes: 25 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,28 @@ place. Ideas for new extensions and questions about how to correctly implement
or consume an API that adheres to the JSON:API specification belong here.

[about]: http://jsonapi.org/about

## JSON Schema
If you would like to update the JSON schemas, you must first install the node.js dependencies :

`
npm install
`

Then you can run the schema validator by running one of the following commands :

`
node ./_schemas/scripts/validator.js
`

or

`
npm run test-schema
`

This script validates all test files against all available versions of the specification.
Some options can be used :
- `--verbose` : allows more verbose output.
- `-f relative-path` : the relative path of the only file to test. For example : `npm run test-schema -- -f _schemas/1.0/response/valid/with_success/complete.json`
- `-v version` : the version of the specification to use to test the files. For example : `npm run test-schema -- -v 1.0`
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy