Change Key for Schema Errors
See original GitHub issueHi, thanks for the great library!
I just have a couple of quick questions that I can’t find in the documentation. Would really appreciate your help with this. Here I go…
I don’t understand why the key in the errors dictionary for schema level errors is "_schema"
. What exactly is the purpose of the _
? I know that this a naming convention for pseudo private variables in python, but I fail to understand how the key is “private” as Marshmallow docs say it can be used by the client code.
Additionally, is there any way to change that to something else on my side? Preferably, I’d just like to have "schema"
as the key instead of "_schema"
. However, I am not aware of the side effects or the unintended consequences this might have on the code. I also have no clue how to go about doing this. So… how exactly can I implement this and are there any side effects? Is changing the default not recommended by your developers? Why?
Thanks again for your time and your help. Really love this library!
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (4 by maintainers)
Top GitHub Comments
This key lies in the same namespace as field names.
We chose
_schema
to avoid name collision with a field calledschema
.Field errors use field name as key.
_schema
is used only for schema-level errors. Those, by nature, don’t have a field name.