Skip to content

Commit 92a3b0d

Browse files
committed
Enable JSON schema validator support for "format" keyword
Support for the JSON schema "format" keyword was moved to a separate package in ajv v7.0.0 (ajv-cli v4.0.0). If this package is not installed and specified as a module via the ajv-cli command, validation against any schema that uses "format" fails, even when the instance document is completely valid. Even though the JSON schema currently in use does not have a "format" keyword, there's no reason one couldn't be added at any moment, so it's safest to just add support now. The change to ajv was done for security purposes when used with untrusted data, which is not a concern here.
1 parent 97c58ac commit 92a3b0d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

.github/workflows/check-taskfiles.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,18 @@ jobs:
4242
location: ${{ runner.temp }}/taskfile-schema
4343

4444
- name: Install JSON schema validator
45-
run: sudo npm install --global ajv-cli
45+
run: |
46+
sudo npm install \
47+
--global \
48+
ajv-cli \
49+
ajv-formats
4650
4751
- name: Validate ${{ matrix.file }}
4852
run: |
4953
# See: https://github.com/ajv-validator/ajv-cli#readme
5054
ajv validate \
5155
--all-errors \
5256
--strict=false \
57+
-c ajv-formats \
5358
-s "${{ steps.download-schema.outputs.file-path }}" \
5459
-d "${{ matrix.file }}"

0 commit comments

Comments
 (0)