【发布时间】:2016-04-15 20:06:20
【问题描述】:
当我的 raml 定义指定我的服务的 post 方法需要 json 时,生成的 post 方法正确地采用了一个封装该 json 并符合我的架构的对象。
但是,并不是我把post方法改成接受application/x-www-form-encoded formParameters,而是生成的post方法不包含每个参数对应的实参。我的预期是错的吗?
之前和工作:
post:
description: blah
body:
application/json:
schema: myschema
example: !include myexample_request_json.json
这会生成一个带有签名的 post 方法:
public Response post(final Myrequest myrequest)
但是将 RAML 更改为:
post:
description: blah
body:
application/x-www-form-urlencoded:
formParameters:
myparam1:
description: aaa
required: true
type: string
我希望生成的 post 方法是:
public Response post(final String myparam1)
但实际上是:
public Response post()
有人能解释一下为什么吗?
谢谢,
保罗
【问题讨论】:
-
你用什么来生成你的方法?
标签: raml