Modernization
- add support for Python versions up through 3.12
- remove support for old Python versions older than 3.7 since test dependencies no longer support them
- remove Python 2.7 support
- remove tests & test commands only relevant to Python 2.7
- remove backwards-compatibility from code
- enable running as a module (
python -m genson
) - modernize package configuration (issue #68)
- Use a valid
schema_uri
in tests (issue #69)
- add
__version__
attr to module and--version
option to CLI tool - add
--encoding
option to CLI tool that overrides default file encoding (fixes #47)
- expose
SchemaStrategy.__eq__()
for extension - add support for Python 3.8
- update Trove classifiers
- Bugfix:
SchemaBuilder.__eq__()
wasn't matching the$schema
keyword correctly - Bugfix: only activate empty
required
option whenrequired
is actualy empty
SchemaStrategies
are now extendable, enabling customSchemaBuilder
classes.- optimize
__eq__
logic
- add support for Python 3.7
- drop support for Python 3.3
- drop support for JSON-Schema Draft 4 (because it doesn't allow empty
required
arrays) - Bugfix: preserve empty
required
arrays (fixes #25) - Bugfix: handle nested
anyOf
keywords (fixes #35)
- add support for
long
integers in Python 2.7 - update test-skipping decorator to use standard version requirement strings
- Bugfix: seeding an object schema with a
"required"
keyword caused an error - Docs: fix mislabeled method
This version was a total overhaul. The main change was to split Schema into three separate classes, making it simpler to add more complicated functionality by having different generator types to handle the different schema types.
SchemaNode
to manage the tree structureSchemaGenerator
for the schema generation logicSchemaBuilder
to manage the public API
SchemaBuilder
is the newSchema
to_dict()
is now calledto_schema()
To make the transition easier, there is still a Schema
class that wraps SchemaBuilder
with a backwards-compatibility layer, but you will trigger a PendingDeprecationWarning
if you use it.
The merge_arrays
option has been removed in favor of seed schemas. You can now seed specific nodes as list or tuple instead of setting a global option for every node in the schema tree.
You can also now seed object nodes with patternProperties
, which was a highly requested feature.
- include
"$schema"
keyword - accept schemas without
"type"
keyword - use
"anyOf"
keyword to help combine schemas - add
SchemaGenerationError
for better error handling - empty
"properties"
and"items"
are not included in generated schemas genson
executable- new
--schema-uri
option - auto-detect object boundaries by default
- new
- Docs: add installation instructions
- Docs: Python 3.6 is now explicitly tested and listed as compatible.
- Bugfix:
add_schema
failed when adding list-style array schemas - Bugfix: typo in readme
- Bugfix: Options were not propagated down to subschemas.
- Bugfix: Empty arrays resulted in invalid schemas because it still included an
items
property. - Bugfix:
items
was being set to a list even whenmerge_arrays
was set toTrue
. This resulted in overly permissive schemas becauseitems
are matched optionally by default. - Improvement: Positional Array Matching - In order to be more consistent with the way JSON Schema works, the alternate to
merge_arrays
is no longer never to merge list items, but instead to merge them based on their position in the list. - Improvement: Schema Incompatibility Warning - A schema incompatibility used to cause a fatal error with a nondescript warning. The message has been improved and it has been reduced to a warning.
- Initial release