Skip to content

enum-error seems to not be formatted correctly #88

@AlexPaven

Description

@AlexPaven

I'm getting this error for a field defined as a string enum:

Expected given value `` in `#/x` to be one of ``

e.g. object { "x": null } validated against the schema

{
  "type": "object",
  "properties": {
    "x": {
      "enum": [
        "a",
        "b"
      ],
      "type": "string",
    }
}

The template specifies {{values}} but this is not provided in the createError arguments. I will try to create a PR for this but I don't know how quick I can get to it...

P.S. I seem to remember seeing <null> instead of empty string in some places but I don't know if this was an older version before the recent big changes... is this intentional?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions