Skip to content

Combine const/enum with type error handling #164

@jdesrosiers

Description

@jdesrosiers

If there's a const or enum, a type error message is unhelpful.

{
  "type": "string"
  "const": "foo"
}
42

Error messages:

  • Expected a string
  • Expected exactly "foo"

The type message isn't helpful because the const message is more specific. To deal with this problem, we can combine the type handler with the const/enum handler and display only the most specific message.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions