i use play-swagger
+ swagger-ui
in project, have request json
body this:
{"country":{"title": "germany"}}'
when annotate method with:
apiimplicitparam(name = "country[title]", value = "country's title", required = true, datatype = "string", paramtype = "body")
it doesn't work in swagger ui, how can tell title
name in country
namespace ?
the best approach define countryrequest
class (also annotations) acts model of request object. reference class when defining apiimplicitparam
. example,
@apimodel(value = "countryrequest") case class countryrequest( @(apimodelproperty @field)(datatype = "string", readonly = false, required = true) title: string, )
incidentally, want define parameter body parameter, should this:
@apiimplicitparams(array( @apiimplicitparam(name = "body", value = "country", required = true, datatype = "com.example.countryrequest", paramtype = "body") )) def postcountry = ...
Comments
Post a Comment