diwand / YapiIdeaUploadPlugin

yapi idea 上传插件,快速生成文档
376 stars 137 forks source link

post方法requestType错误 #108

Closed 24kpure closed 2 years ago

24kpure commented 4 years ago

版本号

all

什么问题

BuildJsonForYapi#getRequest post方法的requestType写死为form

如何复现此问题

上传post类型方法,请求内容为body

方案

需要判断请求参数是否含有requestbody注解

代码片段 image

24kpure commented 4 years ago

代码片段 else if (HttpMethodConstant.POST.equals(yapiApiDTO.getMethod())) { // 支持实体对象接收 yapiApiDTO.setReq_body_type("form"); if (yapiApiDTO.getReq_body_form() != null) { yapiApiDTO.getReq_body_form().addAll(getRequestForm(project, psiParameter, psiMethodTarget)); } else { yapiApiDTO.setReq_body_form(getRequestForm(project, psiParameter, psiMethodTarget)); }