...
 
Commits (2)
from .abbreviate import load_short_schema
from setuptools import setup
setup(
name = 'short-json-schema',
version = '0.0.1',
author = 'Paul Warren',
author_email = 'pdw@blinkace.com',
description = 'Abbreviated syntax for JSON Schema',
packages = ['shortjsonschema'],
install_requires = ['jsonschema' ]
)
#!/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))
from .expand import load
......@@ -162,6 +162,6 @@ class ParseError(Exception):
pass
def load_short_schema(s):
def load(s):
p = Parser()
return p.parse(s)
from jsonschemashort import load_short_schema
from shortjsonschema 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)
......