tlivings / enjoi

Converts a JSON schema to a Joi schema.
Apache License 2.0
283 stars 57 forks source link

keep string enum type #101

Closed nlundquist closed 3 years ago

nlundquist commented 4 years ago

when detecting an enum with type: string the joi validator returned by enjoi is built off the any type instead of string.

this prevents use of some string specific functionality in joi, like case insensitive comparisons against the enum.

this modification makes enjoi return a joi string-typed enum instead.

tlivings commented 3 years ago

Can you add a test case?