Is there a standard on JSON naming?
I see most examples using all lower case separated by underscore, aka snake_case, but can it be used PascalCase or camelCase as well?
Is there a standard on JSON naming? I see most examples using all lower
Share
There is no SINGLE standard, but I have seen 3 styles you mention (“Pascal/Microsoft”, “Java” (
camelCase) and “C” (underscores,snake_case)) — as well as at least one more,kebab-caselikelonger-name).It mostly seems to depend on what background developers of the service in question had; those with c/c++ background (or languages that adopt similar naming, which includes many scripting languages, ruby etc) often choose underscore variant; and rest similarly (Java vs .NET). Jackson library that was mentioned, for example, assumes Java bean naming convention (
camelCase)UPDATE: my definition of “standard” is a SINGLE convention. So while one could claim “yes, there are many standards”, to me there are multiple
Naming Conventions, none of which is “The” standard overall. One of them could be considered the standard for specific platform, but given that JSON is used for interoperability between platforms that may or may not make much sense.