question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"this field has unspecified keys": maybe "unexpected"?

See original GitHub issue

When 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:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
jquensecommented, Jul 4, 2020

You can customize it, yeah. I’m also open to making the default error message clearer

0reactions
jquensecommented, Sep 30, 2020

types aren’t maintained here currently open an Issue on DT please

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found