To install:
$ pip install msrest
BugFixes
- Impossible to serialize XML if model contains UTF8 characters on Python 2.7 #165
- Impossible to deserialize a HTTP response as XML if body contains UTF8 characters on Python 2.7 #165
- Loading a serialized configuration fails with NameError on NoOptionError #162
Thanks to cclauss for the contribution
Features
- Add DomainCredentials credentials for EventGrid
Thanks to kalyanaj for the contribution
Bugfixes
- Make 0.6.x series compatible with pyinstaller again
- sdist now includes tests
Thanks to dotlambda for the contribution
Bugfixes
- Fix list of integers serialization if div is provided #151
- Fix parsing of UTF8 with BOM #145
Thanks to eduardomourar for the contribution
Bugfixes
- Fix regression on credentials configuration if used outside of Autorest scope #135
Features
- Updated experimental async support. Requires Autorest.Python 4.0.64.
Bugfixes
- Fix circular dependency in TYPE_CHECKING mode #128
Bugfixes
- Remove unecessary verbose "warnings" log #126
Features
- The environment variable AZURE_HTTP_USER_AGENT, if present, is now injected part of the UserAgent
- New preview msrest.universal_http module. Provide tools to generic HTTP management (sync/async, requests/aiohttp, etc.)
- New preview msrest.pipeline implementation:
- A Pipeline is an ordered list of Policies than can process an HTTP request and response in a generic way.
- More details in the wiki page about Pipeline: https://github.com/Azure/msrest-for-python/wiki/msrest-0.6.0---Pipeline
- Adding new attributes to Configuration instance:
- http_logger_policy - Policy to handle HTTP logging
- user_agent_policy - Policy to handle UserAgent
- pipeline - The current pipeline used by the SDK client
- async_pipeline - The current async pipeline used by the async SDK client
- Installing "msrest[async]" now installs the experimental async support. Works ONLY for Autorest.Python 4.0.63.
Breaking changes
- The HTTPDriver API introduced in 0.5.0 has been replaced by the Pipeline implementation.
- The following classes have been moved from "msrest.pipeline" to "msrest.universal_http":
- ClientRedirectPolicy
- ClientProxies
- ClientConnection
- The following classes have been moved from "msrest.pipeline" to "msrest.universal_http.requests":
- ClientRetryPolicy
Bugfixes
- Fix "long" on Python 2 if used with the "object" type #121
Thanks to robgolding for the contribution
Bugfixes
- Fix a serialization issue if additional_properties is declared, and "automatic model" syntax is used ("automatic model" being the ability to pass a dict to command and have the model auto-created) # 120
Features
- Support additionalProperties and XML
BugFixes
- Better parse empty node and not string types
- Improve "object" XML parsing
BugFixes
- Fix some XML serialization subtle scenarios
Features
- deserialize/from_dict now accepts a content-type parameter to parse XML strings
Bugfixes
- Fix some complex XML Swagger definitions.
This release likely breaks already generated XML SDKs, that needs to be regenerated with autorest.python 3.0.58
Bugfixes
- Lower Accept header overwrite logging message #110
- Fix 'object' type and XML format
Thanks to dharmab for the contribution
Disclaimer
This released is designed to be backward compatible with 0.4.x, but there is too many internal refactoring and new features to continue with 0.4.x versionning
Features
- Add XML support
- Add many type hints, and MyPY testing on CI.
- HTTP calls are made through a HTTPDriver API. Only implementation is requests for now. This driver API is not considered stable and you should pin your msrest version if you want to provide a personal implementation.
Bugfixes
- Incorrect milliseconds serialization for some datetime object #94
Deprecation
That will trigger a DeprecationWarning if an old Autorest generated code is used.
- _client.add_header is deprecated, and config.headers should be used instead
- _client.send_formdata is deprecated, and _client.put/get/delete/post + _client.send should be used instead
Bugfixes
- Improve SDKClient.__exit__ to take exc_details as optional parameters and not required #93
- refresh_session should also use the permanent HTTP session if available #91
Features
msrest is now able to keep the "requests.Session" alive for performance. To activate this behavior:
- Use the final Client as a context manager (requires generation with Autorest.Python 3.0.50 at least)
- Use client.config.keep_alive = True and client.close() (requires generation with Autorest.Python 3.0.50 at least)
- Use client.config.keep_alive = True and client._client.close() (not recommended, but available in old releases of SDK)
All Authentication classes now define signed_session and refresh_session with an optional session parameter. To take benefits of the session improvement, a subclass of Authentication MUST add this optional parameter and use it if it's not None:
- def signed_session(self, session=None):
session = session or requests.Session()
# As usual from here.
Features
- Disable HTTP log by default (security), add enable_http_log to restore it #86
BugFixes
- Fix incorrect date parsing if ms precision is over 6 digits #82
Features
- Add TopicCredentials for EventGrid client
Bugfixes
- Fix minimal dependency of isodate
- Fix serialisation from dict if datetime provided
Features
- Add LROPoller class. This is a customizable LRO engine. This is the poller engine of Autorest.Python 3.0, and is not used by code generated by previous Autorest version.
Bugfixes
- Date parsing is now compliant with Autorest / Swagger 2.0 specification (less lenient)
Internal optimisation
- Call that does not return a streamable object are now executed in requests stream mode False (was True whatever the type of the call). This should reduce the number of leaked opened session and allow urllib3 to manage connection pooling more efficiently. Only clients generated with Autorest.Python >= 2.1.31 (not impacted otherwise, fully backward compatible)
Bugfixes
- Accept to deserialize enum of different type if content string match #75
- Stop failing on deserialization if enum string is unkwon. Return the string instead.
Features
- Model now accept kwargs in constructor for future kwargs models
Bugfixes
- Do not validate additional_properties #73
- Improve validation error if expected type is dict, but actual type is not #73
Bugfixes
- Fix additional_properties if Swagger was flatten #72
Features
- Add support for additional_properties
- By default, all additional_properties are kept.
- Additional properties are sent to the server only if it was specified in the Swagger, or if "enable_additional_properties_sending" is called on the model we want it. This is a class method that enables it for all instance of this model.
Features
The interpretation of Swagger 2.0 "discriminator" is now lenient. This means for these two scenarios:
- Discriminator value is missing from the received payload
- Discriminator value is not defined in the Swagger
Instead of failing with an exception, this now returns the base type for this "discriminator".
Note that this is not a contradiction of the Swagger 2.0 spec, that specifies "validation SHOULD fail [...] there may exist valid reasons in particular circumstances to ignore a particular item, but the full implications must be understood and carefully weighed before choosing a different course."
This cannot be configured for now and is the new default behvaior, but can be in the future if needed.
Bugfixes
- Optional formdata parameters were raising an exception (#65)
- "application/x-www-form-urlencoded" form was sent using "multipart/form-data". This causes problems if the server does not support "multipart/form-data" (#66)
Features
- Add ApiKeyCredentials class. This can be used to support OpenAPI ApiKey feature.
- Add CognitiveServicesAuthentication class. Pre-declared ApiKeyCredentials class for Cognitive Services.
Features
This make Authentication classes more consistent:
- OAuthTokenAuthentication is now a subclass of BasicTokenAuthentication (was Authentication)
- BasicTokenAuthentication has now a "set_token" methods that does nothing.
This allows test like "isintance(o, BasicTokenAuthentication)" to be guaranted that the following attributes exists:
- token
- set_token()
- signed_session()
This means for users of "msrestazure", that they are guaranted that all AD classes somehow inherits from "BasicTokenAuthentication"
Bugfixes
- Fix regression: accept "set<str>" as a valid "[str]" (#60)
Bugfixes
- Always log response body (#16)
- Improved exception message if error JSON is Odata v4 (#55)
- Refuse "str" as a valid "[str]" type (#41)
- Better exception handling if input from server is not JSON valid
Features
- Add Configuration.session_configuration_callback to customize the requests.Session if necessary (#52)
- Add a flag to Serializer to disable client-side-validation (#51)
- Remove "import requests" from "exceptions.py" for apps that require fast loading time (#23)
Thank you to jayden-at-arista for the contribution
Bugfixes
- Fix regression introduced in msrest 0.4.12 - dict syntax with enum modeled as string and enum used
Bugfixes
- Fix regression introduced in msrest 0.4.12 - dict syntax using isodate.Duration (#42)
Features
- Input is now more lenient
- Model have a "validate" method to check content constraints
- Model have now 4 new methods:
- "serialize" that gives the RestAPI that will be sent
- "as_dict" that returns a dict version of the Model. Callbacks are available.
- "deserialize" the parses the RestAPI JSON into a Model
- "from_dict" that parses several dict syntax into a Model. Callbacks are available.
More details and examples in the Wiki article on Github: https://github.com/Azure/msrest-for-python/wiki/msrest-0.4.12---Serialization-change
Bugfixes
- Better Enum checking (#38)
Bugfixes
- Fix incorrect dependency to "requests" 2.14.x, instead of 2.x meant in 0.4.8
Features
- Add requests hooks to configuration
Bugfixes
- Accept "null" value for paging array as an empty list and do not raise (#30)
Bugfixes
- Fix random "pool is closed" error (#29)
- Fix requests dependency to version 2.x, since version 3.x is annunced to be breaking.
BugFixes
Refactor paging #22:
- "next" is renamed "advance_page" and "next" returns only 1 element (Python 2 expected behavior)
- paging objects are now real generator and support the "next()" built-in function without need for "iter()"
Raise accurate DeserialisationError on incorrect RestAPI discriminator usage #27
Fix discriminator usage of the base class name #27
Remove default mutable arguments in Clients #20
Fix object comparison in some scenarios #24
Bugfixes
- Allow Model sub-classes to be serialized if type is "object"
Bugfixes
- Fix polymorphic deserialization #11
- Fix regexp validation if '\w' is used in Python 2.7 #13
- Fix dict deserialization if keys are unicode in Python 2.7
Improvements
- Add polymorphic serialisation from dict objects
- Remove chardet and use HTTP charset declaration (fallback to utf8)
Bugfixes
- Remove paging URL validation, part of fix Azure/autorest#1420
Disclaimer
In order to get paging fixes for impacted clients, you need this package and Autorest > 0.17.0 Nightly 20160913
Bugfixes
- Better exception message (Azure/autorest#1300)
Bugfixes
- Fix serialization if "object" type contains None (Azure/autorest#1353)
Bugfixes
- Fix compatibility issues with requests 2.11.0 (Azure/autorest#1337)
- Allow url of ClientRequest to have parameters (Azure/autorest#1217)
This version has no bug fixes, but implements new features of Autorest: - Base64 url type - unixtime type - x-ms-enum modelAsString flag
Behaviour changes
- Add Platform information in UserAgent
- Needs Autorest > 0.17.0 Nightly 20160525
Bugfixes
- Read only values are no longer in __init__ or sent to the server (Azure/autorest#959)
- Useless kwarg removed
Behaviour changes
- Needs Autorest > 0.16.0 Nightly 20160426
Bugfixes
- Manage integer enum values (Azure/autorest#879)
- Add missing application/json Accept HTTP header (Azure/azure-sdk-for-python#553)
Behaviour changes
- Needs Autorest > 0.16.0 Nightly 20160324
Bugfixes
- Deserialisation of generic resource if null in JSON (Azure/azure-sdk-for-python#544)
Bugfixes
- urllib3 side effect (Azure/autorest#824)
Bugfixes
- Source package corrupted in Pypi (Azure/autorest#799)
Behavioural Changes
- Removed custom logging set up and configuration. All loggers are now children of the root logger 'msrest' with no pre-defined configurations.
- Replaced _required attribute in Model class with more extensive _validation dict.
Improvement
- Removed hierarchy scanning for attribute maps from base Model class - relies on generator to populate attribute maps according to hierarchy.
- Base class Paged now inherits from collections.Iterable.
- Data validation during serialization using custom parameters (e.g. max, min etc).
- Added ValidationError to be raised if invalid data encountered during serialization.
Bugfixes
- Source package corrupted in Pypi (Azure/autorest#718)
Bugfixes
- Fixed bug in exception logging before logger configured.
- Initial release.