Capitalization of response field name is being changed
See original GitHub issueDescription
We have a field in our Batch pool GET command called nodeAgentSKUId
. In debug mode I can confirm this is the capitalization used in the response for the command az batch pool show <pool-id>
.
In the Azure Python SDK, this field name is deserialized to: node_agent_sku_id
, and it seems that the CLI code is then converting this name to: nodeAgentSkuId
.
We have a customer that is trying to use the json output as input for new requests and this change in capitalization has caused some difficulties. Is there anyway that the CLI core could use the serialization key from the response object _attribute_map to maintain the same field names used in the response?
Alternatively, is there a way for us to override the way this JSON is serialized in the Batch command module on a command-by-command basis?
Thanks!
(Although these issues are in batch-extensions - they refer to commands that are part of our standard CLI command module) Batch CLI issue: https://github.com/Azure/azure-batch-cli-extensions/issues/29
Update:
We’ve found an additional instance of this happening: username
-> userName
https://github.com/Azure/azure-batch-cli-extensions/issues/30
Environment summary
Install Method: How did you install the CLI? (e.g. pip, interactive script, apt-get, Docker, MSI, nightly)
pip
CLI Version: What version of the CLI and modules are installed? (Use az --version
)
azure-cli (2.0.10)
OS Version: What OS and version are you using?
Windows
Shell Type: What shell are you using? (e.g. bash, cmd.exe, Bash on Windows)
cmd.exe
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (10 by maintainers)
Top GitHub Comments
@lmazuel is working on making the serialization process case insensitive at the SDK level, which will automagically fix this for us. 👍
@annatisch this should be fixed now thanks to @lmazuel. While the CLI will still adjust the casing, the SDK will accept the altered value. The following should all be accepted:
nodeAgentSKUId
,nodeagentskuid
,node_agent_sku_id
,nodeAgentSkuId