activist
activist copied to clipboard
Allow for `URL` to be maintained as a part of backend identifiers in the frontend
Terms
- [X] I have searched open and closed feature requests
- [X] I agree to follow activist's Code of Conduct
Description
This issue is related to the work in #1004 to directly return camelCase from the backend. One downside of this is specifically URL, where the conversion of _url will go to Url. All instances of URL were thus changed to Url for simplicity of conversion, but it would be nice to include a custom parser that inherits from djangorestframework-camel-case that would allow for URL to be returned instead.
Along with this we need to discuss if we'd do the same with _id to convert it to ID instead of Id. Other identifiers should also be considered :)
Contribution
Happy to discuss and work on this once #1004 is merged in!
One consideration for this is whether we should convert the Swagger UI back to snake case and then just do a conversion on the frontend for cases of Url.
Hey @UnknownSean8 👋 In talking about this a bit with @to-sta, we decided a few things:
- Let's leave the Swagger UI as camelCase as it should match the results we're getting in the frontend
- Let's not worry about id
- In the case of URL, if the change is going to happen, then we'll need to figure out a custom parse on the backend level via djangorestframework-camel-case - potentially inheriting from its parser class for those that are
_urlthat we want to beURL
Feel free to look into this, but let's definitely keep the current setup for now and not stress too much about this!
Hello, I would be happy to discuss and work on this if #1004 has been merged in!
Would be great to get some assistance here as well, @JerryW04! Let us know if the documentation for djangorestframework-camel-case has anything about a custom conversion class that could be used to fix conversions for thing like _url 😊
Happy to discuss potential solutions along the way!
hey @andrewtavis can i pick this issue?
Let's stick to #1225 for now, @rohityadav2604, but maybe we can also add you here later. Would be great if you finalized the currently open PR, @JerryW04! Please let us know if you need support :)
is this issue still open
Hey @tejasai2007 👋 Is still open, yes :) You'd be very welcome to look into this! Please let us know if you have questions or need support!
Taking a look at this a bit, there seems to be a lot of code that would need to be written and maintained to get the _url to *URL conversion working, and it'd need to be done in both directions. There's no option to do this automatically, so it's best if we just agree that this is how it'll be in the frontend.