Skip to content

Commit

Permalink
setup: unpin jsonschema version (#9)
Browse files Browse the repository at this point in the history
Changes:
 - use latest available jsonschema version,
 - add tests for using remote references
  • Loading branch information
rethil authored Jan 2, 2025
1 parent 8836f71 commit 8b93ccb
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 1 deletion.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ license_files =
py_modules = check_yamlschema
python_requires = >=3.8
install_requires =
jsonschema<4.18.0
jsonschema
pyyaml
requests

Expand Down
10 changes: 10 additions & 0 deletions tests/referenced_person.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"properties": {
"reference": {
"$ref": "https://raw.githubusercontent.com/jmlrt/check-yamlschema/refs/heads/main/tests/person.json"
}
},
"additionalProperties": false
}
48 changes: 48 additions & 0 deletions tests/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,51 @@ favorite_food:
tropical: bananas
nuts: peanuts
sweets: raisins
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/jmlrt/check-yamlschema/refs/heads/main/tests/food.json
food: # Some YAML document
- vegetables: tomatoes
- fruits:
citrics: oranges
tropical: bananas
nuts: peanuts
sweets: raisins
---
# yaml-language-server: $schema=https://raw.githubusercontent.com/jmlrt/check-yamlschema/refs/heads/main/tests/person.json
name: Martin Devloper # Some other YAML document
age: 26
hobbies:
- painting
- playing_music
- cooking
programming_languages:
java: Intermediate
python: Advanced
javascript: Beginner
favorite_food:
- vegetables: tomatoes
- fruits:
citrics: oranges
tropical: bananas
nuts: peanuts
sweets: raisins
---
# yaml-language-server: $schema=./referenced_person.json
reference:
name: Martin Devloper # Some other YAML document
age: 26
hobbies:
- painting
- playing_music
- cooking
programming_languages:
java: Intermediate
python: Advanced
javascript: Beginner
favorite_food:
- vegetables: tomatoes
- fruits:
citrics: oranges
tropical: bananas
nuts: peanuts
sweets: raisins

0 comments on commit 8b93ccb

Please sign in to comment.