Reputation: 1230
I'm trying to change the type of a parameter on the generated swagger contract, but it looks like the @ApiParam#type
property is not working.
ResponseEntity<Void> delete(
@ApiParam(
value = "The id of the object",
required = true,
type = "java.lang.String") Integer id);
Doing this has no effect in swagger-ui, and id is still being shown as Integer.
Does anyone knows a workaround for this?
Upvotes: 2
Views: 6874
Reputation: 493
I think you should use "string"
not "java.lang.String"
.
The annotation is not @ApiParam, you can use @ApiImplicitParam
, and use dataType="string"
The supported type as below:
Upvotes: 0
Reputation: 27018
You have to use @ApiImplicitParam
@ApiImplicitParam(dataType = "string", name = "id")
ResponseEntity<Void> delete(Integer id);
Upvotes: 3