Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

支持3.0的版本开源了 #73

Open
puhaiyang opened this issue Aug 20, 2022 · 1 comment
Open

支持3.0的版本开源了 #73

puhaiyang opened this issue Aug 20, 2022 · 1 comment

Comments

@puhaiyang
Copy link

花了一下午把3.0版本的api也开发好了。

其源码如下:https://github.com/puhaiyang/swagger2word

不想下源码的也支持docker直接使用额,具体源码文件里有写

@SnowZero
Copy link

SnowZero commented Feb 1, 2023

@puhaiyang
您好,我试了这个版本,很好用
但发现有个案例产出的接口描述(description)不完全,在这个案例下description会变成 "上传档案"
能否协助修正呢?

使用的swagger json如下

{
  "openapi": "3.0.1",
  "info": {
    "title": "API)",
    "version": "v1"
  },
  "paths": {
    "/api/api-announceinfo-uploadfile": {
      "post": {
        "tags": [
          "公告資訊"
        ],
        "summary": "上傳檔案",
        "description": "Sample request:\r\n            \r\n        Sort\tInteger\t排序代碼\r\n        UploadFile\tfile\t檔案\r\n        File_Id\tstring\t檔案代碼\r\n        \r\n       var fileData = new FormData();\r\n       fileData.append(\"UploadFile\", files[0]);\r\n       fileData.append(\"File_Id \", \"xxxxx\");\r\n       fileData.append(\"Sort\",2);\r\n        $.ajax({\r\n        url: \" /api/API-AnnounceInfo-UploadFile \",\r\n           type: 'post',\r\n           processData: false,\r\n           contentType: false,\r\n           data: fileData,\r\n        headers:\r\n           {\r\n           Token: \"xxxx\"\r\n          }, \r\n           success: function(response) {\r\n               console.log(response);\r\n           },\r\n           error: function(jqXHR, textStatus, errorThrown) { console.log(jqXHR); console.log(textStatus); console.log(errorThrown); }\r\n       });",
        "parameters": [
          {
            "name": "File_Id",
            "in": "query",
            "description": "檔案代碼",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Sort",
            "in": "query",
            "description": "排序代碼",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          }
        ],
        "requestBody": {
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "properties": {
                  "UploadFile": {
                    "type": "string",
                    "description": "上傳檔案 Upload",
                    "format": "binary"
                  }
                }
              },
              "encoding": {
                "UploadFile": {
                  "style": "form"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/StringDataResponseBase"
                }
              },
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StringDataResponseBase"
                }
              },
              "text/json": {
                "schema": {
                  "$ref": "#/components/schemas/StringDataResponseBase"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants