- Model instances are now pickleable - PR #372
- Improve equality checks, most notably fixing an issue when
internally_dereference_refs
was set toTrue
- PR #371
Warning
This is release is technically backward incompatible with 5.16.0 as it is removing the equality feature on Spec objects. We're not releasing a major version mostly because we don't expect users are using it.
If you're a user using it please make sure to use the is_equal
methods. They behave as the __eq__
methods added in 5.16.0 without altering the hashability feature of the objects.
- Replace __eq__ with is_equal to allow hashability - PR #364
- Drop support for Python 3.5.0 and previous Python 3 versions - PR #366
- Fix validation of nullable polymorphic objects - Issue #359, PR #367
- Update
msgpack
depedency (asmsgpack-python
is deprecated) - PR #368 - Thanks vanschelven for your contribution. - Improve typing annotations - PR #361
- Add equality and deepcopy support for Spec objects - PR #360
- Properly build the list of required properties for a schema with
allOf
from the sub-schemas - PR #358 - Thanks nickgaya for your contribution! - Add type annotations to
is_ref
,is_list_like
andis_dict_like
- PR #356
- Add option to automatically base64-encode/decode strings with byte format - PR #351 - Thanks nickgaya for your contribution!
- Ensure PEP-561 compatibility - PR #352 Thanks nickgaya for your contribution!
- Enhance documentation, typing of
bravado_core.model.Model
- PR #354 - Thanks nickgaya for your contribution! - Update Model equality method - PR #355
- Improve header validation error message - PR #347 Thanks brycedrennan for your contribution!
- Fix Spec flattening regression - PR #350
- Fix
isinstance
regression - PR #345
The release is mainly based on performance improvements of marshalling and unmarshalling processes.
Model
instances use__slots__
and@lazy_class_attribute
to reduceModel
class footprint - PR #330unmarshal_schema_object
honours the additional properties and default values - PR #333unmarshal_model
/unmarshal_object
do not raiseSwaggerMappingError
in case of unknown polymorphic objects (better distinction between unmarshalling and validating processes) - PR #333- Refactor
bravado_core.unmarshal
module to enhance runtime performances - PR #336 @memoize_by_id
performance improvements when used withkwargs
only - PR #337- Refactor
bravado_core.marshal
module to enhance runtime performance - PR #339
- Prevent
DeprecationWarning
in Python 3.7 - PR #326 - Ensure compatibility with Windows Platform - PR #327, PR #328
- Allow
Spec
subclasses to provide their own$ref
handlers - PR #323 - Fix model name and model discovery bugs, better logic for including models in flattened spec - PR #324
- Add deepcopy support to
Model
instances - PR #325
- Do not throw
SwaggerMappingError
in case of missing body with optional body parameter - Issue #321, PR #322
- Fix issue with jsonschema 3.0 compatibility on Python 2.7 - Issue #318, PR #319, PR #320
- Ensure that flattening Swagger Spec with
$ref: None
will not cause unbounded recursion - PR #315 - Enhance
is_ref
detection to recognize only objects with$ref
attribute andstring
value as reference - PR #315
- Add
use_spec_url_for_base_path
configuration option - PR #300 - Thanks DStape for your contribution! - Ensure
jsonschema >= 3
compatibility - PR #304 - Minor improvement on discriminator validation - PR #302
- Fix security object validation issue - PR #294
- Fix unbounded recursion during object validation (if
internally_dereference_refs
is enabled) - PR #297 - Fix api_url generation - PR #295. Thanks mulmschneider for your contribution!
- Swagger Spec flattening - fix regression that led to some model definitions not having the
x-model
marker anymore - PR #293 - Fix marshalling of array params that use collectionFormat
multi
- PR #292
- Swagger Spec flattening - use model names instead of generated keys - PR #284
- Swagger Spec flattening - replace inline models with top level definitions - PR #285
- Fix query parameter marshalling in case of boolean parameters - Issue #281 - PR #286
- Properly sanitize names with multiple leading digits, handle more edge cases correctly - PR #282
- Make sure spaces in path param values are quoted using percent notation instead of using
+
. Issue #278, PR #279
- Fix regression if
internally_dereference_refs
is used. Issue #275, PR #276
- No longer make sure that all config keys are known; this allows users of the library to store additional configuration. - PR #274
- Refactor: model discovery is now handled in
bravado_core.model
- PR #270 - Remove deprecated methods from Model type - PR #270
- Remove deprecated parameters from
bravado_core.spec_flattening.flattened_spec
- PR #269 - Ensure that models in
#/definitions
of referenced files are discovered - PR #273
Warning
This release contains breaking changes!
The signature of bravado_core.spec_flattening.flattened_spec
has been updated.
The following methods have been removed from the public interface: bravado_core.model.tag_models
, bravado_core.model.bless_models
, bravado_core.model.collect_models
and bravado_core.spec.post_process_spec
.
- Fix marshalling and unmarshalling of optional body parameters. PR #268
- Add support for Content-Disposition filename - PR #262. Thanks elmirjagudin for your contribution!
- Improve specs flattening and dereferencing in case of relative references - PR #263
- Fix bug where multiple schemes in the spec would sometimes cause a
SwaggerSchemaError
- PR #260
- Catch TypeErrors during param unmarshalling, allowing JSON Schema to handle the error - Issue #258, PR #259. Thanks Nick DiRienzo for your contribution!
- Models are generated only for objects - PR #246.
- Fix: ensure that models do not have references if
internally_dereference_refs
is used - PR #247. - Model name detection uses title attribute too - PR #249.
- Duplicated models do not raise exception if
use_models
is not used - PR #253. - Alert or warn if pre-tagged duplicate models are found - PR #254.
- Make sure unsanitized param names are used when unmarshalling a request - PR #245.
- Expose the determine_object_type method as part of our API - PR #244.
- Sanitize resource and parameter names so that they're valid Python identifiers. It uses the same logic as for operationIds - invalid characters are replaced with underscores, multiple consecutive underscores are merged into one, and leading / trailing underscores are removed. Using the unsanitized names will still work - Issue #200, PR #243.
- Allow overriding built-in default formats - Issue #235, PR #240. Thanks Brian J. Dowling for your contribution!
- Include additionalProperties in a models' __repr__ - PR #242. Thanks again Brian J. Dowling!
- Use yaml.safe_load for parsing specs - PR #241.
- Remove strict isinstance check when marshalling models - PR #236.
- Ensure
internally_dereference_refs
works with recursive specs - PR #234.
- Speed up marshalling and unmarshalling of objects - PR #226.
- Use
msgpack-python
instead ofu-msgpack-python
for performance improvements - Issue #227, PR #228.
- Add support for msgpack in responses (i.e. when unmarshalling) - Issue #214, PR #216.
- Improve performance by removing debug logging when dereferencing - PR #208.
- Don't remove unrecognized configs; fixes compatibility with bravado - PR #218.
- New config
internally_dereference_refs
that can significantly speed up unmarshalling. Currently disabled by default - PR #204. - Added support for new extension
x-sensitive
to scrub sensitive values from validation errors. Please check the Sensitive Data documentation for further details - PR #213. - Fixed an issue that would cause validation errors if
obj_type
wasNone
- PR #196. - Fixed handling of defaults for array parameters - PR #199.
- Performance improvements - PR #207.
- Properly marshal a model even if it's not created from the same
Spec
instance - PR #194.
type
is no longer required. By default, validation will not be performed iftype
is omitted. This is configurable withdefault_type_to_object
- Issue #166, PR #192, PR #183, PR #193
- Make sure all models are properly tagged when flattening the spec - PR #191.
- Improve spec flattening: recognize response objects and expose un-referenced models - PR #184.
- Fix a bug when marshalling properties with no spec that have the value
None
- PR #189.
- Fix marshalling of
null
values for properties withx-nullable
set totrue
- Issue #185, PR #186. Thanks Jan Baraniewski for the contribution! - Add
_asdict()
method to each model, similar to what namedtuples have - PR #188.
- Make unmarshalling objects roughly 30% faster - PR #182.
- Add support for Swagger spec flattening - PR #177.
- Fix handling of API calls that return non-JSON content (specifically text content) - PR #175. Thanks mostrows2 for your contribution!
- Fix error message text when trying to unmarshal an invalid model - PR #179.
- Fix support for object composition (allOf) for data passed in the request body - PR #167. Thanks Zi Li for your contribution!
- Return the default value for an optional field missing in the response - PR #171.
- Fix unmarshalling of null values for properties with no spec - Issue #163, PR #165.
- Fix backward-incompatible Model API change which renames all model methods to have a single underscore infront of them. A deprecation warning has been added - Issue #160, PR #161. Thanks Adam Ever-Hadani for the contribution!
- Added support for nullable fields in the format validator - PR #143. Thanks Adam Ever-Hadani
- Add include_missing_properties configuration - PR #152
- Consider default when unmarshalling - PR #154
- Add discriminator support - PR #128, PR #159. Thanks Michael Jared Lumpe for your contribution
- Make sure pre-commit hooks are installed and run when running tests - PR #155, PR #158
- Security Requirement validation (for ApiKey) - PR #124
- Allow self as name for model property, adds new "create" alternate model constructor - Issue #125, PR #126.
- Allow overriding of security specs - PR #121
- Adds minimal support for responses with text/* content_type.
- Support for model composition through the allOf property - Issue #7, PR #63, PR #110. Thanks David Bartle for the initial contribution!
- Fix issue with header parameter values being non-string types - PR #115.
- Adds support for security scheme definitions, mostly focusing on the "apiKey" type - PR #112.
- Fixes around unmarshalling, x-nullable and required behavior - Issue #108, PR #109. Big thanks to Zachary Roadhouse for the report and pull request!
- Fix AttributeError when trying to unmarshal a required array param that's not present - PR #111.
- Check if a parameter is bool-type before assuming it's a string - PR #107. Thanks to Nick DiRienzo for the pull request!
- Add support for
x-nullable
- Issue #47, PR #64 and PR #103. Thanks to Andreas Hug for the pull request! - Fix support for vendor extensions at the path level - PR #95, PR #106. Thanks to Mikołaj Siedlarek for the initial pull request!
- Add basepython python2.7 for flake8, docs, and coverage tox commands
- coverage v4.2 was incompatible and was breaking the build. Added --append for the fix.
- Accept tuples as a type list as well.
- Fix marshalling of an optional array query parameter when not passed in the service call - PR #87
- More robust handling of operationId which contains non-standard chars - PR #76
- Provide a client ingestible version of spec_dict with x-scope metadata removed. Accessible as Spec.client_spec_dict - Issue #78
- Better handling of query parameters that don't have a value - Issue #68
- Allow marshalling of objects which are subclasses of dict - PR #61
- Fix boolean query params to support case-insensetive true/false and 0/1 - Issue #70
- Support for Swagger specs in yaml format - Issue #42
- Fix validation of server side request parameters when collectionFormat=multi and item type is not string - Issue #66
- Fix unmarshalling of server side request parameters when collectionFormat=multi and cardinality is one - PR #75
- Fix unmarshalling of an optional array query parameter when not passed in the query string.
- Support for recursive $refs - Issue #35
- Requires swagger-spec-validator 2.0.1
- Unqualified $refs no longer supported.
Bad:
{"$ref": "User"}
Good:{"$ref": "#/definitions/User"}
- Automatic tagging of models is only supported in the root swagger spec file. If you have models defined in $ref targets that are in other files, you must manually tag them with 'x-model' for them to be available as python types. See Model Discovery for more info.
- Fix the creation of operations that contain shared parameters for a given endpoint.
- Added http
headers
tobravado_core.response.IncomingResponse
.
- Added docs on how to use User-Defined Formats.
- Added docs on how to Configure bravado-core.
- formats added as a config option
- Automatically tag models in external $refs - Issue #45 - see Model Discovery for more info.
- User-defined formats are now scoped to a Swagger spec - Issue #50 (this is a non-backwards compatible change)
- Deprecated bravado_core.request.RequestLike and renamed to bravado_core.request.IncomingRequest
- Added
make docs
target and updated docs (still needs a lot of work though)
- Fixed validation of user-defined formats - Issue #48
- Support relative '$ref' external references in swagger.json
- Fix dereferencing of jsonref when given in a list
- Raise MatchingResponseNotFound instead of SwaggerMappingError when a response can't be matched to the Swagger schema.
- Add reason to IncomingResponse
- Handle user defined formats for serialization and validation.
- Move http invocation to bravado
- Fix unicode in model docstrings
- Require swagger-spec-validator 1.0.12 to pick up bug fixes
- Better unicode support
- Python 3 support
- Fixed file uploads when marshalling a request
- Renamed ResponseLike to IncomingResponse
- Fixed repr of a model when it has an attr with a unicode value
- Use basePath when matching an operation to a request
- Refactored exception hierarchy
- Added use_models config option
- Initial release