Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
JSON
Short JSON Schema
Commits
295c49a6
Commit
295c49a6
authored
Oct 18, 2019
by
Paul Warren
Browse files
Restructuring package
parent
9017d57e
Changes
7
Hide whitespace changes
Inline
Side-by-side
jsonschemashort/__init__.py
deleted
100644 → 0
View file @
9017d57e
from
.abbreviate
import
load_short_schema
shortjsonschema.py
0 → 100755
View file @
295c49a6
#!/usr/bin/env python3
import
jsonschema
import
shortjsonschema
import
sys
import
json
with
open
(
sys
.
argv
[
1
])
as
f
:
s
=
shortjsonschema
.
load
(
f
.
read
())
jsonschema
.
Draft4Validator
.
check_schema
(
s
)
print
(
json
.
dumps
(
s
,
indent
=
4
))
shortjsonschema/__init__.py
0 → 100644
View file @
295c49a6
from
.expand
import
load
jsonschema
short/abbreviate
.py
→
short
jsonschema
/expand
.py
View file @
295c49a6
...
...
@@ -162,6 +162,6 @@ class ParseError(Exception):
pass
def
load
_short_schema
(
s
):
def
load
(
s
):
p
=
Parser
()
return
p
.
parse
(
s
)
jsonschema
short
/tests/__init__.py
→
short
jsonschema/tests/__init__.py
View file @
295c49a6
File moved
jsonschema
short
/tests/conftest.py
→
short
jsonschema/tests/conftest.py
View file @
295c49a6
File moved
jsonschema
short
/tests/test_short_schema.py
→
short
jsonschema/tests/test_short_schema.py
View file @
295c49a6
from
jsonschema
short
import
load
_short_schema
from
short
jsonschema
import
load
import
jsonschema
import
pytest
...
...
@@ -222,7 +222,7 @@ def test_short_schema():
]
for
t
in
tests
:
s
=
load
_short_schema
(
t
[
"input"
])
s
=
load
(
t
[
"input"
])
assert
s
==
t
[
"output"
]
try
:
jsonschema
.
Draft4Validator
.
check_schema
(
s
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment