-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support automatic snake_case/camelCase conversion #94
Comments
Love this proposal!
Definitely commonly used through the platform :) This proposal would save a step/time for engineers.
Would this need to be opt-in, to avoid this being a breaking change for consumers?
Is the idea here to use |
I'd also be curious if this would be configured for all requests, or if it could be configured on a per-request basis. |
It will have to be opt-in to avoid introducing a breaking change. |
Since our backend services are written in Python, our MFEs have to convert API responses to camelCase.
@edx/frontend-platform
exports a util functioncamelCaseObject
for this purpose and a preliminary search yields 102 results where it is being used in our repos. It feels tedious to have to manually convert the casing every time and forgetting to do so could lead to bugs and inconsistencies in the code.It would be beneficial if our http clients in frontend-platform supported automatic case conversions out of the box, configurable during instantiation.
Here is a package that uses Axios interceptors to handle the conversions.
(converts both incoming data to camelCase and outgoing data to snale_case
Example of what we have to do today:
Example of what it could look like:
The text was updated successfully, but these errors were encountered: