question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Capitalization of response field name is being changed

See original GitHub issue

Description

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:closed
  • Created 6 years ago
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
tjprescottcommented, Aug 3, 2017

@lmazuel is working on making the serialization process case insensitive at the SDK level, which will automagically fix this for us. 👍

1reaction
tjprescottcommented, Aug 23, 2017

@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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does Jackson 2 not recognize the first capital letter if the ...
Hence, when you change the "L" to lower case Jackson was able to figure it out the field you wanted to map. Having...
Read more >
Different capitalization on Response Headers - Help
However, header field names MUST be converted to lowercase prior to their encoding in HTTP/2. A request or response containing uppercase header ...
Read more >
Auto capitalization of name input fields - UX Stack Exchange
I call your "let the user change name when displeased" answer, and raise you a "design a solution so that the user is...
Read more >
Forced Capitalization of First & Last Name Fields
I am wondering if there is a way to force the capitalization of the First & Last Name fields in my forms when...
Read more >
3. Capitalization Rules - GovInfo
Common nouns and adjectives in proper names. 3.5. A common noun or adjective forming an essential part of a proper name is capitalized;...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found