Skip to content
This repository has been archived by the owner on Apr 26, 2020. It is now read-only.

Lower-case keys after update to Nancy 0.22 #8

Closed
igorkulman opened this issue Mar 16, 2014 · 3 comments
Closed

Lower-case keys after update to Nancy 0.22 #8

igorkulman opened this issue Mar 16, 2014 · 3 comments

Comments

@igorkulman
Copy link

I have updated Nancy from 0.21 to 0.22 and noticed a change that broke my server. All the JSON keys in JSON response (Response.AsJSON) changed to lower case. Is this a known issue or a bug? If it is not a bug, how to make it behave like before?

@Corstiaan84
Copy link

Hi, any news on this? :-)

@khellang
Copy link
Member

This is not a bug. It's in the breaking changes document, has both an issue and a pull request. To get back the old behavior, set JsonSettings.RetainCasing = true.

@cloud-garbage
Copy link

I'm relatively new to Nancy, and just stumbled upon this thread when I was trying to figure out why in the world the casing of my strings was being altered; in my case, stock symbols - ex: MSFT, AAPL, NVDA - were coming back as mSFT, aAPL, nVDA. the guy in the issue @khellang linked to says that "99% of the time", this sort of automagic alteration is wanted. perhaps my use case (data that is explicitly all-caps) is in that 1%, but I'm still having trouble imagining why changing a method's return data AT ALL is a good default. does anyone have ideas about this? the workaround (using Nancy.Json.JsonSettings.RetainCasing = true) is easy enough to implement, so I'm not exactly complaining, but I do realize that the act of asking about this decision is implicitly a challenge of that decision. I also realize that I might just currently be trapped in my 1% use-case perspective, unable to see the larger picture; if someone could point me to that larger picture, that'd be cool :P

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants