Closed harikrishnanmurthy closed 5 years ago
I'm at work right now, so I can't get into anything really precise, just a first draft.
jsonschemastuff is delegated to the http://www.jsonschema2pojo.org/, and the maven plugin can push arguments to thelibrary. We have examples of this.
Fixed it by adding attribute "default" : null
Thanks a lot @jpbelang for sending useful links
While generating Java models from raml using raml-to-jaxrs-maven-plugin, all the Lists in java class are initialized by default to new ArrayList<>(). How do we prevent this?
Description We have an attribute defined as an array in our raml spec. While trying to generate the Java model classes, the resulting List is initialized by default to new ArrayList<>(). This is causing problems in our application since an empty arraylist and null are treated differently.
When the maven plugin is run, the resulting java code is
private List references= new ArrayList<>();
The reference field is not mandatory(optional)
What we want is:
private List references = null;
jaxrs-code-generator version raml-to-jaxrs-maven-plugin version : 3.0.1