"this field has unspecified keys": maybe "unexpected"?
See original GitHub issueWhen strict-validating an object against a schema which has noUnknown()
set a corresponding error message might look like:
ValidationError: this field has unspecified keys: foo
I understand that from the schema’s point of view an unexpected key is unexpected because it hasn’t been specified.
However, from the point of view of the entity that created the invalid document I think “unspecified” is semantically confusing.
The invalid value/object/document contains an unexpected or invalid or unknown property (I think those three are easy to understand). Should we maybe adjust the error message? Feedback welcome.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Catch unexpected Hash keys in dry-validation
Hi, This topic is related to https://github.com/dry-rb/dry-validation/issues/179 on trying to get an error on unexpected Hash keys during validation with a ...
Read more >How to allow any other key in Joi [duplicate] - Stack Overflow
With this schema, it only allows two keys a and b . If I pass any other key, say, c , it throws...
Read more >Error handling - Apollo GraphQL Docs
An unspecified error occurred. When Apollo Server formats an error in a response, it sets the code extension to this value if no...
Read more >Field Reference - The workflow engine for Kubernetes
WorkflowTemplate is the definition of a workflow template resource ... specifies the configMap name and key containing the artifact repository config.
Read more >Compile Error Messages - IBM
Msg ID Message Text Explanation
1001 no statement to compile The rule is does not contain any statements.
1002 unexpected end of program The rule...
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
You can customize it, yeah. I’m also open to making the default error message clearer
types aren’t maintained here currently open an Issue on DT please