新手问题 关于 swagger 的问题

liuyang_1991 · March 05, 2018 · Last by liuyang_1991 replied at March 06, 2018 · 2096 hits

请问怎么修改 application/json 为 Content-type: application/x-www-form-urlencoded

liuyang_1991 in [北京] 星起招聘 Ruby 工程师 mention this topic. 05 Mar 23:20

没看懂 form-urlencoded 不就是一般的 HTTP 表单提交么,用 postman 之类很容易模拟吧,你要是调网络库不也是看 API 写的事么?

这是一个 swagger 文档的问题,还是通信的问题?

Reply to zhandao

swagger 的问题,就是非 get 得请求 content-type 是 application/json, 想改成 application/x-www-form-urlencoded

?那把 yml 里中的媒体类型改掉不就是了

Reply to jasl

嗯!用 postman 是好使的!但是 swagger 都生成文档了,想问问怎么修改,老版本的没有这个问题,改了新版本就有这个问题了,上面的图是 swagger 的官方文档里的,但是不知道怎么在修改

Reply to zhandao

给个例子?😂

这个不知道了,没用过 Swagger

是 swagger2 吧?按 文档,就是改“consumes”呀 ...

You can use the consumes and produces keywords to specify the MIME types understood by your API.

或者说你还有别的意思?

Reply to zhandao

嗯嗯!谢谢

You need to Sign in before reply, if you don't have an account, please Sign up first.