-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Update Response #9668
Update Response #9668
Conversation
Update response to get camel case and modified attribute value
Update response.py
Is this coming from an AI model? The changes don't look like they're aiming a certain fix. |
from rest_framework import status | ||
|
||
# Function to convert snake_case string to camelCase | ||
def camel_case(snake_str): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may want to look at https://github.com/vbabiy/djangorestframework-camel-case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the share.
I did it by myself. I have got a great solution from @browniebroke. |
I did this change because of message return null.
I also tried to update message value by but it is not working . Message always return null. Could you please help me to update message null to my targeted custom message. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Message null returning issue solved. Please consider to approve the update. then I will be able to use Response instead of custom response method.
Note: Before submitting a code change, please review our contributing guidelines.
Description
I have solved the message value return issue. And added camel case method to return json response field in camel case. I have also added status code list to check status and return the status as per response status.