swagger-gradle-plugin
swagger-gradle-plugin copied to clipboard
ignore example tag of @ApiParam annotation
trafficstars
I have the problem that my example tag given in the @ApiParam annotation is not shown in the json file or in the yaml file
this is the @ApiParam annotation of my PUT method parameter
@ApiParam(name = "object", value = "full object with changed values", required = true,
examples = @Example(value = {
@ExampleProperty(mediaType = "default", value = "{\"#\": \"1ou8d\", \"val\": \"sample\"}")
}))
Map<String, String> body
this is my build.gradle file
plugins {
id "com.benjaminsproule.swagger" version "1.0.7"
}
dependencies {
compile 'io.swagger:swagger-annotations:1.5.15'
}
swagger {
apiSource {
springmvc = false
locations = ['com.domain.storage.impl.SpiderApi', 'com.domain.storage.impl.StorageApi']
schemes = ['http']
basePath = '/rest'
info {
title = 'Spider API'
version = 'v1'
description = 'Spider REST API for store and getting data'
contact {
email = '[email protected]'
name = 'Name'
url = 'https://domain.com'
}
}
outputFormats = ['json', 'yaml']
swaggerDirectory = "${project.projectDir}/src/com/domain/storage/impl"
swaggerFileName = 'spiderapi'
jsonExampleValues = true
}
}
and this is the part of the generated yaml file describing this param
...
- in: "body"
name: "object"
description: "full object with changed values"
required: true
schema:
type: "object"
additionalProperties:
type: "string"
...