A wasteful pattern: APIs that return PascalCase JSON


A wasteful pattern: APIs that return PascalCase JSON.

The workaround:
1. Convert JSON to camelCase on the client.
2. Convert JSON back to PascalCase to send it to the API. 😬

The solution?
1. Return camelCase JSON from the API.
2. Accept camelCase JSON in the API.
Oh, and this need not be a breaking change. The API can accept an optional header that requests camelCased JSON. 😎

This way, it can continue to serve PascalCased JSON by default.

View original on X