Swagger client codegen does not include optional methods

1k views Asked by At

I am using swagger codegen (on this Zoura swagger) to create a Java/rest template client. I am using the swagger Gradle plugin:

id "org.hidetake.swagger.generator" version "2.11.0"

Here is the config for it:

{
  "library": "resttemplate",
  "dateLibrary": "java8",
  "hideGenerationTimestamp": true,
  "modelPackage": "zuora.model",
  "apiPackage": "zuora.api",
  "invokerPackage": "zuora",
  "clientPackage" : "zuora.client"
}

The client does get generated, however even though there are many optional fields they are not getting created as such and everything is required. Am I missing something?

1

There are 1 answers

0
Stefa On

I just had this issue and solved it like this:

<configOptions>
     <fullJavaUtil>false</fullJavaUtil>
</configOptions>

If you look at the code, you will find that the condition is inverted.