Hi Ron, Thanks for your quick reply.
The annotation I am referring to is actually part of swagger-core's swagger-annotation module, not spring-fox. You can find it here <https://github.com/swagger-api/swagger-core/blob/master/modules/swagger-annotations/src/main/java/io/swagger/annotations/ApiModelProperty.java> . Regards, Yuri On Friday, August 4, 2017 at 6:08:07 PM UTC+1, Ron wrote: > > Hi Yuri, > > > > We’re not the ones maintaining SpringFox. Would suggest filing a ticket on > the project directly. > > > > > > > > *From: *<[email protected] <javascript:>> on behalf of Yuri > Matrosovs <[email protected] <javascript:>> > *Reply-To: *"[email protected] <javascript:>" < > [email protected] <javascript:>> > *Date: *Friday, August 4, 2017 at 08:39 > *To: *Swagger <[email protected] <javascript:>> > *Cc: *Lukasz Kwasek <[email protected] <javascript:>> > *Subject: *Not possible to set a default value using ApiModelProperty > > > > Hi, > > > > In our project we use Swagger via SpringFox. And in our API description we > want to provide a default value for some fields in a Model Property. > > > > But, unfortunately there is no standard way of doing it, i.e. by using > ApiModelProperty annotation, like: > > > > @ApiModelProperty ( > name = "Name", > required = true, > defaultValue = "John Doe" // <--- this is not available in > ApiModelProperty interface > ) > > > > And according to the Swagger specification, properties should be able to > have "default" values. See: > https://swagger.io/specification/#properties-99 > > > > Are you ok if we fork your project, add the field in to the annotation and > push it back? Or is there any other way of providing a default value for > the property? > > > > Regards, > > Yuri > > -- > You received this message because you are subscribed to the Google Groups > "Swagger" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] <javascript:>. > For more options, visit https://groups.google.com/d/optout. > > -- You received this message because you are subscribed to the Google Groups "Swagger" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
