#how do I generate POJOs from XSD without XML annotations?

3 messages · Page 1 of 1 (latest)

floral iron
#

I need to generate a JSON schema within Java application and I've come across few maven plugins which create JSON schema strings from Java classes. Our code has generated .java classes but they're all generated from XSD using jaxb but with annotations like @XmlElement and using these classes might not yield proper JSON schema.

Removing them programmatically using regex and all seems error prone.

I want to generate plain and simple POJOs from XSD without any annotations so that they can be used for generating JSON schema.

Or better yet, how can I generate Java classes with JSON annotations like @JsonProperty from XSD itself? I couldn't find a solution to this so my previous question still stands.

Application is built on Java, Spring boot, Maven, SOAP.

The only solution I tried so far is I used jaxb2-maven-plugin with <arguments> -X none but it threw me an error saying couldn't resolve -X and arguments tag is deprecated.

Could anyone please help with this?

Thank you!!

nova forgeBOT
#

This post has been reserved for your question.

Hey @floral iron! Please use /close or the Close Post button above when your problem is solved. Please remember to follow the help guidelines. This post will be automatically marked as dormant after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.