Description
I have the following schema:
items:
type: string
enum:
- Admin
- Prescriber
- Clinician
When I try to validate the array field with input ["Admin"]
- I get the following error:
code=400, message=Request body has an error: doesn't match the schema: Error at \"/permissions\":JSON value is not one of the allowed values, internal=Request body has an error: doesn't match the schema: Error at \"/permissions\":JSON value is not one of the allowed values\nSchema:\n {\n \"enum\": [\n \"Prescriber\",\n \"Admin\",\n \"Clinician\"\n ],\n \"items\": {\n \"type\": \"string\"\n },\n \"type\": \"array\"\n }\n\nValue:\n [\n \"Admin\"\n ]\n"
It seems like it is comparing the array ["Admin"]
vs iterating through the array on line:
kin-openapi/openapi3/schema.go
Lines 641 to 656 in 989d00f