Mendix JSON : Pascal case vs Camel Case

  When we auto generate rest collection from Mendix Entity, all JSON attributes follow PASCAL case.    From most of sample json, we see camel case. Mendix 10.1.0 follows Open API 3 standards.   Camel case is generally used in most json, however its not mentioned whether pascal case is correct or camel case is correct. Can someone suggest with this one?
1 answers

As you say, “camelCase” is used more often than “PascalCase” or “snake_case”, although it's more a convention than correct/incorrect question. As long as sender and receiver agree to the used naming convention, it's functionally ok.

Using Mendix message definitions, automatically PascalCase will be introduced, however: if your attributes contain underscores, it may become a mix.

So my recommendations:

  • always use PascalCase within your Mendix application (entities and attributes) and prevent the usage of underscores (only use them for associations).
  • always use camelCase for your JSON definition, which means custom naming in your JSON structure or Message Definition

See also my idea to make this a global configuration in Mendix Studio Pro: