openapi2typescript icon indicating copy to clipboard operation
openapi2typescript copied to clipboard

Content-Type 类型为 application/x-www-form-urlencoded 生成的代码错误

Open fengwuxp opened this issue 1 year ago • 0 comments

应该是 serviceController.njk 第 113 行的判断

   {%- if api.hasHeader and api.body.mediaType not in ["multipart/form-data", "application/x-www-form-urlencoded"]%}
    headers: {
      {%- if api.body.mediaType %}
      'Content-Type': '{{ api.body.mediaType | safe }}',
      {%- endif %}
    },
    {%- endif %}

中的判断忘记删除 application/x-www-form-urlencoded 了

fengwuxp avatar Feb 19 '24 02:02 fengwuxp