Field names in validation errors are different from schema
See original GitHub issueI have a form which has a python field raw_description
which ends up in schema as rawDescription
. However if field doesn’t have a valid value I get a validation error for field raw_description
which is not in schema.
class UpdateEventModelForm(forms.ModelForm):
raw_description = forms.CharField()
class Meta:
model = EventModel
fields = ('name', 'from_date', 'to_date')
mutation updateEvent($input: UpdateEventInput!) {
updateEvent(input: $input) {
errors {
field
messages
}
}
}
{
"input": {
"id": 123,
"rawDescription": ""
}
}
Response
{
"data": {
"updateEvent": {
"errors": [
{
"field": "raw_description",
"messages": [
"This field is required."
]
}
],
"event": null
}
}
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Raising validation errors for multiple field names in schema ...
I could raise a number of ValidationError via a list, but I can't assign these errors to different field names.
Read more >Understanding schema errors | HESA
Understanding schema errors ; Field. A field is an attribute (data item) of an entity. This refers to the short field name as...
Read more >How to Fix Schema Validation Errors
The most common schema validation error is "either "offers", "review", or "aggregate rating" should be specified." Here's how to fix it.
Read more >Is possible to include property name in the error-message ...
I have noticed that the field name is not included as part of the var://service/error-message variable when a schema validation error occurs for...
Read more >Handling Validation Errors - python-jsonschema
The full schema that this error came from. This is potentially a subschema from within the schema that was passed in originally, or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@igo I’m assuming you’re using graphene-django here? Have you tried the
CAMELCASE_ERRORS
setting? https://docs.graphene-python.org/projects/django/en/latest/settings/#camelcase-errors– Yoda