當我的raml定義指定我的服務的post方法期望json時,生成的post方法正確地使用封裝該json並符合我的模式的對象。RAML formParameters沒有使它發佈方法簽名
但是,並非我已經將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)
但已經改變了腎錯構瘤到:
post:
description: blah
body:
application/x-www-form-urlencoded:
formParameters:
myparam1:
description: aaa
required: true
type: string
我本來期望的產生後處理方法爲:
public Response post(final String myparam1)
而是它是:
public Response post()
有人能解釋一下爲什麼嗎?
謝謝
保羅
你用什麼來產生你的方法? –