Azure / msrest-for-python

The runtime library "msrest" for AutoRest generated Python clients.
MIT License
41 stars 64 forks source link

Improvement of serialization #36

Closed lmazuel closed 7 years ago

lmazuel commented 7 years ago

@tjprescott what you need should be already there. Feel free to ask me to add tests, or test the branch on the CLI. I will add the to_dict before merging the PR and I'd like your "approve" :)

This PR adds support for "RestAPI like" key as input in the dict syntax: Example, you were able to write client.accounts.get({"storage_account_id": id}) (attribute version), you are now able to use client.accounts.get({"StorageAccountID": id}) (RestAPI key version). Both can be mixed. Case insensitive. In case of conflict (like StorageAccountID and storageaccountid in the same dict), will fail with a KeyError while trying to match the second one.

codecov-io commented 7 years ago

Codecov Report

Merging #36 into master will increase coverage by 0.97%. The diff coverage is 95.53%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #36      +/-   ##
==========================================
+ Coverage   88.26%   89.24%   +0.97%     
==========================================
  Files           9       10       +1     
  Lines        1142     1255     +113     
==========================================
+ Hits         1008     1120     +112     
- Misses        134      135       +1
Impacted Files Coverage Δ
tests/storage_models/resource.py 100% <100%> (ø)
msrest/serialization.py 91.21% <95.26%> (+0.85%) :arrow_up:
msrest/configuration.py 42.25% <0%> (+4.22%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 7179ddd...519358e. Read the comment docs.

lmazuel commented 7 years ago

@annatisch should help for https://github.com/Azure/azure-cli/issues/4061