Changelog#
This page has changelogs for all releases of Oblate.
v1.2.1#
Fix missing oblate.fields package during installation of v1.2.0.
v1.2.0#
New features#
Add
FieldNotSetexception to be raised on accessing fields without values.Add
Schema.copy()method for copying schema instances.Add
Schema.preprocess_data()for preprocessing of input data.Add
oblate.validate_types()function for type validation.
Improvements#
All fields now have relevant attributes to access values passed to constructor.
Field accessing now raises a special exception.
Schema constructor now raises
TypeErrorif non-mapping type is passed as data.
Bug fixes#
v1.1.0#
New features#
Add
fields.Listfor acceptingliststructure.Add
fields.Setfor acceptingsetstructures.Add
fields.Dictandfields.TypedDictfor handling dictionaries.Add
fields.TypeExprfor validating types using simple type expressions.Add
fields.Anyfield as a no validation field.Add
fields.Literalfield to accept pre-defined literal values.Add
fields.Unionfor basic union type validation.Add
validate.Rangevalidator for validating integer ranges.Add
validate.Lengthvalidator for validating length of sized types.Add
validate.Regexvalidator for validating values using regular expression.Add
validate.Excludevalidator for disallowing/excluding specific values.Add
validate.Orvalidator for OR’ing the result of multiple validators.Add
Schema.__schema_post_init__()method as a post initialization hook.Add
ErrorContext.metadatafor storing extra error information.Add
GlobalConfig.warn_unsupported_typesto control behaviour on using unsupported types.Add
Field.nameandField.schemaproperties.Add
init_kwargsparameter infields.Objectto support passing initialization arguments.
Improvements#
fields.Objectfield now supports passingSchemainstances directly instead of raw data.fields.Field.format_error()no longer requires super call and default error messages are resolved automatically.
v1.0.0#
This version brings an entire rewrite of the library. Many features have been removed along with many additions and breaking changes. 0.2.0 and former are not compatible with this version.
For an overview of changes, see this pull request.
v0.2.0#
New features#
- Add support for partial schemas
Add
fields.Partialfield.Add
Schema.is_partial()helper method.
Add
ValidationError.is_field_error()helper to check whether exception relates to a field.Add
Schema.after_init_hook()method that gets called when schema is finished initializing.Add
load_keyanddump_keyparameters tofields.Fieldto control the field names during serialization/deserialization of data.Add
ValidationError.stateto allow storing state to an error that can later be accessed.Add
includeandexcludeparameters toSchema.dump().Add
rawparameter toField.validate()andField.add_validator()to validate raw value.
Improvements#
Objectfields now support raw data serialization upon setting after initialization.Schemaand all fields now have__slots__defined for performance sake.User defined validators are now ran after field
value_*methods by default. Such that, validators now take serialized value instead of raw one. For previous behaviour,rawparameter must be used.
Bug fixes#
Fix
Schema.dump()returning empty dictionary.Fix fields returning improper values when initializing multiple schemas.
Fix unable to set
Noneon nullable fields after initialization.Fix field getting the new value using the setter even when the validations fail.
Documentation#
Add “Tutorials” section
v0.1.0#
Initial release