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

Mechanism required to customize schema for object property #18

Closed
rpdai opened this issue Sep 10, 2013 · 2 comments · Fixed by #19
Closed

Mechanism required to customize schema for object property #18

rpdai opened this issue Sep 10, 2013 · 2 comments · Fixed by #19
Milestone

Comments

@rpdai
Copy link
Contributor

rpdai commented Sep 10, 2013

If I have a custom annotation on the property of an object, this cannot be visited as the JsonFormatVisitorWrapper takes only the type of the property. I've looked also at subclassing ObjectSchema but since this takes the property name as a String only, seems I'd have to do some reflection to get back to the property itself.

I can see a significant number of use cases of wanting to customize a schema being related to the information associated with an object property (custom annotations, documentation, validation, etc.). My particular use-case is that the schema should provide some information for client-side validation, from the bean validation API.

I've seen threads suggesting that this would be possible (http://jackson-users.ning.com/forum/topics/json-schema-generation-with-jackson-module-jsonschema, http://jackson-users.ning.com/forum/topics/handling-a-custom-annotation-when-generating-json-schema) but I can't see it, myself.

Is there some mechanism I'm missing?

@rpdai
Copy link
Contributor Author

rpdai commented Sep 11, 2013

Pull request #19 provides the desired functionality to resolve this issue

@cowtowncoder
Copy link
Member

Will be in 2.3.0

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