swagger-api / swagger-play

Apache License 2.0
330 stars 181 forks source link

Swagger case class parameters required by default when no Option[] #28

Open guillaumebadin opened 8 years ago

guillaumebadin commented 8 years ago

Hello, I try swagger-play and this is a very good plugin.

The argument response = classOf[AnalysisHydratedForApp] work well but by default all args are optional in my swagger doc whereas I have a case class with no-option.

So is it possible to change this things (maybe can i change it if you send me some clues).

Have a good day.

fehguy commented 8 years ago

Hi @guillaumebadin can you please upgrade to swagger-play2 1.5.0-SNAPSHOT? It was pushed to sonatype snapshots yesterday and has major improvements.

guillaumebadin commented 8 years ago

@fehguy My play project is 2.3 so it is impossible :-( . Thank you for your response.

fehguy commented 8 years ago

because of how items are loaded, no it's not possible to do so. Consider extending your class with a default parameters?

sl0thentr0py commented 7 years ago

Hi, I would also be interested in knowing the easiest way of making case class fields required by default unless they are an option. I'm using Play 2.4.6 and swagger-play2 1.5.1