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

Option JsonSchema generation with jackson-module-jsonSchema #81

Closed
wants to merge 1 commit into from
Closed

Option JsonSchema generation with jackson-module-jsonSchema #81

wants to merge 1 commit into from

Conversation

theon
Copy link

@theon theon commented May 23, 2013

We have been trying to use jackson-module-jsonSchema in combination with jackson-module-scala to generate JSON Schema from Scala case classes.

We have found it to work pretty well so far, however it doesn't render Options correctly. They come out as {"type":"any"}.

This pull request contains a failing test showing the problem. I don't have a fix and I don't know enough to be able to determine if this is a problem in jackson-module-scala or jackson-module-jsonSchema, but and happy to do some further digging if required.

"...stringValue":{"type":"[any"]}}}" was not equal to "...stringValue":{"type":"[string","required":false]}}}" (OptionSerializerTest.scala:88)

@christophercurrie
Copy link
Member

Thanks for the test case. I haven't done any work to support the new jsonSchema module, so it's likely that this feature is just not implemented. I'll have a look and can hopefully have a fix out for the next patch release.

@theon
Copy link
Author

theon commented May 23, 2013

That's great. Thanks for the clarification.

@christophercurrie
Copy link
Member

I've added support for this for Options, but it's possible (likely?) that this new module is not supported by other Scala types, particularly the collections. I'll do what I can to get them fixed up for the next patch.

@theon
Copy link
Author

theon commented May 25, 2013

Thanks for the quick turnaround!

I'll try this out on Monday. If I remember correctly I think the Scala collections we are using (I think just List at the moment) looked like they were rendering correctly. I'll double check on Monday.

Thanks.

@theon
Copy link
Author

theon commented May 28, 2013

I've retested with 2.2.2-SNAPHOT and it all looks good. Option and List are not rendering as "type":"any".

Thanks again Christopher

@christophercurrie
Copy link
Member

Excellent, I'm glad the Collections were able to pick up on core Jackson support for this feature, which has always been my goal. :)

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 this pull request may close these issues.

None yet

2 participants