Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error message if value is not defined in enum #113

Closed
johannesluedke opened this issue Jun 21, 2021 · 1 comment · Fixed by #116
Closed

Improve error message if value is not defined in enum #113

johannesluedke opened this issue Jun 21, 2021 · 1 comment · Fixed by #116

Comments

@johannesluedke
Copy link

In the error {"errors":[{"source":{"pointer":"/data/type"},"title":"is not valid: \"my_type1\""}]} I have no clues which are the valid values, which would be nice to print in case of an enum so it's easier to find out what error one did when specifying the endpoint in the openapi.yaml

@ahx ahx changed the title Improve error message Improve error message if value is not defined in enum Aug 4, 2021
@ahx
Copy link
Owner

ahx commented Aug 4, 2021

Hi @johannesluedke! Thanks for the issue.
What do you think about this change? It changes the error to something like:

{
  "errors": [
    {
      "source": {
        "pointer": "/type"
      },
      "title": "value \"unknown-type\" is not defined in enum",
      "detail": "value can be one of pet, plan"
    }
  ]
}

@ahx ahx closed this as completed in #116 Aug 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants