-
Notifications
You must be signed in to change notification settings - Fork 629
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
Comments
@puhaiyang 使用的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
花了一下午把3.0版本的api也开发好了。
其源码如下:https://github.com/puhaiyang/swagger2word
不想下源码的也支持docker直接使用额,具体源码文件里有写
The text was updated successfully, but these errors were encountered: