-
Notifications
You must be signed in to change notification settings - Fork 769
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
Apply camel case converter to field names in DRF errors #514
Apply camel case converter to field names in DRF errors #514
Conversation
Though TypeError has type string[], I think nested serializers should be supported too? like if |
I quite like this, even thought I think I'll rewrite the implementation of the errors for the serializer mutation, but I'll probably keep the current implementation for backwards compatibility. @syrusakbary what do think of this pull request? It breaks the compatibility with user using errors and having fields with _ in them, but it is definitely nicer than before I guess |
Should form errors convert to camel case too? https://github.com/graphql-python/graphene-django/blob/master/graphene_django/forms/mutation.py#L49 |
I can implement that in this pr but both are breaking changes so need decision from author first. |
Maybe for easy release we need another option in the schema. Like:
Or if it related only for this packed use some global config like And check this options here with deprecation message. In major release check only And what if |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This looks like it's still a useful change so don't close this stalebot! @kalekseev so that we can get this merged without it being a breaking change could you add a flag like |
adb0947
to
e55363e
Compare
e55363e
to
d2b4a02
Compare
Hi guys, updated pr with recursive conversion to camel case for nested serializers support, added flag to enable this change. |
👍 |
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.
Love the ErrorType.from_errors
method.
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.
This looks great thanks @kalekseev !
This change eliminates inconsistency between schema field names and serializer errors field names