You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
xjc, wrapped in jaxb2-maven-plugin, automatically generates a GroupHeader78 Class where, for example, the mentioned property msgId is a String, annotated with Bean Validation @SiZe(min = 1, max = 35) thanks to -XJsr303Annotations switch from krasa-jaxb-tools
Found a solution!
setting true mapSimpleTypeDef (default is false) in jaxb:globalBindings did the trick <jaxb:globalBindings mapSimpleTypeDef="true">
Map35Text and other simpleType declarations like that are generated as Class by xjc with a value string property with restrictions.
Therefore jsonSchema generates
but I must admit that it depends on xjc and not on jsonSchema that does its job accordingly.
I'm getting closer...
I don't know if using Lombok those classes turn to something like c language typedef struct and so getting more practical in this context
I have an xsd schema that features many complexTypes like this
where Max35Text is just a referenced simpleType based on xs:string with some restrictions
xjc, wrapped in jaxb2-maven-plugin, automatically generates a GroupHeader78 Class where, for example, the mentioned property msgId is a String, annotated with Bean Validation @SiZe(min = 1, max = 35) thanks to -XJsr303Annotations switch from krasa-jaxb-tools
The generated JSON schema excerpt is the following
Instead of the in-lined string restrictions I would like to get a schema like this
where Max35Text is defined aside (in the same file), just like the simpleType in the original xsd schema
I couldn't figure out if it's possible to configure the plugin to get this done.
Any help/suggestion is appreciated
The text was updated successfully, but these errors were encountered: