All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
Types of changes are:
- Security in case of vulnerabilities.
- Deprecated for soon-to-be removed features.
- Added for new features.
- Changed for changes in existing functionality.
- Removed for now removed features.
- Fixed for any bug fixes.
0.15.1 - 2023-08-06
- Added license to
setup.py
0.15.0 - 2023-07-21
- Added support for the
description
field, which will be mapped to class docstring for schemas with"type": "object"
.
- Bumped PyYAML dependency to version 6 due to upstream bug yaml/pyyaml#601
0.14.0 - 2023-02-16
- Relaxed dependency version pinning for typing-annotations
0.13.5 - 2021-10-18
- Relaxed dependency version pinning
0.13.4 - 2021-04-01
- Relaxed dependency version pinning
0.13.3 - 2021-03-30
- Bumped PyYAML dependency to '5.4'.
0.13.2 - 2021-02-22
- Prevented
tests
folder from being packaged.
0.13.1 - 2020-10-31
- Relaxed version dependency on
json-ref-dict
.
0.13.0 - 2020-10-21
- Added support for Python 3.7 and 3.8.
- Fixed a typo in property validation error messages.
- Fixed a bug where special characters were improperly handled in
"object"
type schema parsing (#77).
0.12.0 - 2020-10-03
- Corrected terminology relating to DSL (Domain Specific Language).
0.11.0 - 2020-10-03
- Added support for
required
keyword class argument toObject
subclasses. - Added support for
Object
model inheritance. - Added inline constructor for
Object
DSL elements,Object.inline
- Setting properties dynamically now automatically binds them.
- Fixed bug where renamed required fields are incorrectly validated.
0.10.0 - 2020-04-23
- Expanded documentation to include source links, among other things.
0.9.0 - 2020-04-20
- Added functions for converting DSL defined schemas to JSON Schema
dictionaries.
serialize_json
supports serialization of schemas with definitions and references.serialize_element
supports simple inline serialization of elements.
- Documentation including a tutorial and API reference.
- Moved
serialize_python
to fromstatham.serializer
tostatham.serializers
. serialize_python
now dynamically infers which imports to include based on the supplied elements.- Rewrote
statham.orderer.Orderer
in functional style, renamed toorderer
. This allows more general use of some of its functionality via theget_children
andget_object_classes
functions in this module. - Attempting to parse schemas with recursive references now
raises a
FeatureNotImplementedError
. - Raised version of
json-ref-dict
to0.6.0
- now supports references with URL-encoded characters. - Property names which conflict with reserved names now have an underscore appended by the parser (previously prepended).
- Better validation error messages on unbound elements.
- Fixed missing imports in generated python modules.
- Type hints are now correctly detected when installed.
0.8.0 - 2020-04-09
default
is now a class argument on subclasses ofObjectMeta
.- Bump
json-ref-dict
to version0.5.3
. - Improve implementation of official JSON Schema test suite.
0.7.0 - 2020-04-04
- Added support for
dependencies
keyword. - Added support for
enum
keyword. - Added support for
contains
keyword. - Added support for
const
keyword. - Added support for
propertyNames
keyword. - Added support for
uniqueItems
keyword. - Added support for
minProperties
andmaxProperties
keywords.
0.6.0 - 2020-04-03
- Added support for
not
keyword. - Added support for "tuple" definition of
items
keyword. - Added support for
additionalItems
keyword. - Added support for
patternProperties
keyword.
- Raised dependency on
json-ref-dict
to version0.5.1
. - Additional properties are now exposed on a model's
__getitem__
instead of under anadditional_properties
attribute. - Additional properties are now declared as a class argument to
Object
subclasses.
- Removed
ObjectOptions
class.
0.5.0 - 2020-03-30
- Git submodule containing official JSON Schema test suite, and a
corresponding parameterized test. These tests will run if environment
variable
OFFICIAL_TEST_SUITE
is set totrue
. - Added support for boolean schemas.
- Parsing schemas wih unsupported keywords now raises a
FeatureNotImplementedError
.
- Fixed bug causing some properties to be parsed twice.
- Properties which conflict with Python keywords are now re-mapped on generated models.
- Fixed bug where default is overriden on Object classes in parsers.
- Fixed bug causing partially duplicated properties.
Number
schema elements now acceptint
values, but convert them tofloat
.- Fixed bug causing some subschemas in
oneOf
andanyOf
statements to be skipped. - Fixed bug in
MultipleOf
due to floating point errors. - Fixed bug where anonymous object properties are not renamed.
- Fixed unanchored pattern searching on strings.
0.4.0 - 2020-03-29
- Added support for
allOf
keyword. Ensures match against all schemas, returns instance of the first. - Added support for multiple composition keywords within one schema, including compositions of outer keywords and composition keywords.
- Property names which are not valid python attribute names are now mapped to a valid python attribute. Whitespace is replaced by "_" and symbols are assigned their Unicode names.
0.3.0 - 2020-03-29
- Added
source
keyword argument toProperty
. This allows mapping of input properties to differing model attribute names. - Added support for
additionalProperties
keyword argument. - Added support for
default
as a property name in object schemas. - Added support for
self
as a property name in object schemas. - Added support for
default
and validation keywords in un-typed schemas. - Added support for array
items
keyword in un-typed schemas. - Added support for object
required
,properties
andadditionalProperties
keywords in un-typed schemas.
- Moved bulk of python serialization logic to DSL element methods.
0.2.0 - 2020-03-20
- A JSONSchema DSL (see
statham/dsl/
) has been added, and is now used for both the internal representation and the output. anyOf
composition keyword now supported.- Creates models for each schema provided in the list.
- Generated models will instantiate the first compatible model, based on the order they are presented.
oneOf
composition keyword now supported.- Creates models for each schema provided in the list.
- Generated models will instantiate any compatible model, but fail if more than one succeeds.
- Naming of anonymous schemas declared within the items
of an array now uses the context of the array name.
- For example, items of a list declared under field
volumes
, would previously have been namedItems
, but would now be namedVolumesItem
.
- For example, items of a list declared under field
- Generated models switched to using a new DSL model.
- Schemas defined in the top-level
definitions
keyword are now detected. - Now uses
json-ref-dict
version 0.5.0. Enables compatibility with a wider range of schemas. - Name counters only increment for objects on autogenerated names.
- Dependencies on
attrs
andjinja2
.
- Name collisions where the last segment of the JSON Pointer for a schema's location was the same as another.
- Array schemas now accept missing items keyword as an implicit blank schema.
- Error reporting improved on cyclical dependencies.
- Fixed bug in title formatting.
0.1.1 - 2019-12-13
- Fix documentation now that package is available via
pip
.
0.1.0 - 2019-12-13
- Command run as
statham --input {reference} [--output {output}]
- Resolve local and remote JSONSchema references to load and parse JSONSchema documents.
- Class-generation based on singular types.
- Class-generation based on combinations of
boolean
number
integer
string
null
- Declaration resolution for declared models.
- Validation support for the following type-specific keywords:
array
:items
minItems
maxItems
object
:properties
required
boolean
:default
number
/integer
:default
minimum
exclusiveMinimum
maximum
exclusiveMaximum
multipleOf
string
:default
format
(via extensible validation register)pattern
minLength
maxLength
null
Nothing here.