Skip to content

Commit

Permalink
feat: changed schema validator library
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasdavis committed Jul 10, 2024
1 parent 5593c70 commit 7a892ba
Show file tree
Hide file tree
Showing 7 changed files with 244 additions and 211 deletions.
63 changes: 47 additions & 16 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jsonresume/schema",
"version": "1.0.1",
"version": "1.1.1",
"description": "JSON Resume Schema",
"private": false,
"main": "validator.js",
Expand All @@ -27,7 +27,7 @@
"validator.js"
],
"dependencies": {
"z-schema": "^4.2.4"
"jsonschema": "^1.4.1",
},
"devDependencies": {
"ajv-cli": "^3.3.0",
Expand Down
11 changes: 5 additions & 6 deletions schema.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"additionalProperties": false,
"$schema": "http://json-schema.org/draft-07/schema#",
" $id": "http://example.com/example.json",
"additionalProperties": true,
"definitions": {
"iso8601": {
"type": "string",
"description": "e.g. 2014-06-29",
"description": "Similar to the standard date type, but each section after the year is optional. e.g. 2014-06-29 or 2023-04",
"pattern": "^([1-2][0-9]{3}-[0-1][0-9]-[0-3][0-9]|[1-2][0-9]{3}-[0-1][0-9]|[1-2][0-9]{3})$"
}
},
Expand Down Expand Up @@ -274,9 +275,7 @@
"description": "e.g. Certified Kubernetes Administrator"
},
"date": {
"type": "string",
"description": "e.g. 1989-06-12",
"format": "date"
"$ref": "#/definitions/iso8601"
},
"url": {
"type": "string",
Expand Down
4 changes: 2 additions & 2 deletions test/__test__/projects.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
]
},
"keywordsInvalid": {
"keywords": [
"projects": [
{
"keywords": null
}
Expand Down Expand Up @@ -161,7 +161,7 @@
]
},
"rolesInvalid": {
"keywords": [
"projects": [
{
"roles": null
}
Expand Down
Loading

0 comments on commit 7a892ba

Please sign in to comment.