Skip to content
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: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
- name: Install dependencies
run: yarn install

- name: Verify that canonical-data.json files adhere to canonical-schema.json
- name: Verify that canonical-data.json files adhere to their json schema
run: yarn test

- name: Verify that all UUIDs are indeed unique
Expand Down Expand Up @@ -100,16 +100,16 @@ jobs:

- name: Verify that all scenarios are defined in the schema
run: |
canonical_schema_file="canonical-schema.json"
canonical_data_schema_file="canonical-data.schema.json"
scenarios_file="SCENARIOS.txt"

fail=0

while read -r scenario; do
jq -e ".definitions.scenario.enum | index(\"$scenario\")" $canonical_schema_file > /dev/null
jq -e ".definitions.scenario.enum | index(\"$scenario\")" $canonical_data_schema_file > /dev/null

if [ $? -eq 1 ]; then
echo "$canonical_schema_file: scenario '$scenario' is missing from the '.definitions.scenario.enum' field."
echo "$canonical_data_schema_file: scenario '$scenario' is missing from the '.definitions.scenario.enum' field."
fail=1
fi
done < $scenarios_file
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Test data can be incorporated into a track's test suites manually or extracted b

## Test Data Format

The file format is described in [canonical-schema.json](./canonical-schema.json), but it is easier to understand with an example:
The file format is described in [canonical-data.schema.json](./canonical-data.schema.json), but it is easier to understand with an example:

```json
{
Expand Down Expand Up @@ -254,7 +254,7 @@ There are also some conventions that must be followed:

```json
{
"$schema": "https://github.com/exercism/problem-specifications/blob/main/canonical-schema.json"
"$schema": "https://github.com/exercism/problem-specifications/blob/main/canonical-data.schema.json"
}
```

Expand All @@ -267,7 +267,7 @@ When creating a new exercise the design team needs to be informed so that a new

## Automated Tests

`canonical-data.json` for each exercise is checked for compliance against the [canonical-schema.json](canonical-schema.json).
`canonical-data.json` for each exercise is checked for compliance against the [canonical-data.schema.json](canonical-data.schema.json).
In order to run these tests, you will need to have `yarn` installed on your system.
Install them from [here](https://yarnpkg.com/en/docs/install).

Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions exercises/linked-list/canonical-data.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"exercise": "linked-list",
"comments": [
"In order to keep the interface for the exercise close or equal to the ",
"description.md and also satisfying the canonical-schema.json, the only ",
"In order to keep the interface for the exercise close or equal to the ",
"description.md and also satisfying the canonical-data schema, the only ",
"properties are pop, push, shift, unshift. Some tracks also implement ",
"delete and count, via Track-Inserted hints. ",
" ",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"ajv-cli": "^3.3.0"
},
"scripts": {
"test": "ajv -s canonical-schema.json -d \"exercises/*/canonical-data.json\"",
"test-one": "ajv -s canonical-schema.json -d"
"test": "ajv -s canonical-data.schema.json -d \"exercises/*/canonical-data.json\"",
"test-one": "ajv -s canonical-data.schema.json -d"
},
"resolutions": {
"minimist": "^1.2.3"
Expand Down