FasterXML / jackson-module-jsonSchema

Module for generating JSON Schema (v3) definitions from POJOs
371 stars 135 forks source link

Schema with enum array - when deserialized, the enum values are lost #77

Closed jakubneubauer closed 8 years ago

jakubneubauer commented 9 years ago

When I serialize JsonSchema containing array of enums, it is correctly serialized like this:

{
   "type":"array",
   "items":{"type":"string","enum":["FOO","BAR"]}
}

But when I deserialize it again, I will get an array of string, but the enum set of the StringSchema is empty. I have a unit test that demonstrates it but I'm not sure how to attach it to the github issue... Will try it after creation...

jakubneubauer commented 9 years ago

Have it - the JUnit that reproduces it: https://gist.github.com/jakubneubauer/3df768198a6bc51e9daf

cowtowncoder commented 9 years ago

Thanks!

cowtowncoder commented 9 years ago

Interestingly enough, I can reproduce this with 2.6(.3) but not with 2.7.0-SNAPSHOT. I am guessing maybe this is duplicate of #81?

cowtowncoder commented 8 years ago

Since test passes, assumed fixed for 2.7.0, probably due to fixes in jackson-databind.