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

导入swagger失败 #13

Open
cnHuaShao opened this issue Jun 3, 2020 · 0 comments
Open

导入swagger失败 #13

cnHuaShao opened this issue Jun 3, 2020 · 0 comments
Labels
bug Something isn't working

Comments

@cnHuaShao
Copy link
Contributor

cnHuaShao commented Jun 3, 2020

Bug 描述
ono.js:64 Uncaught (in promise) SyntaxError: [object Object] is not a valid Swagger API definition
at index.js:65

** 导入文件**

{
  "openapi": "3.0.1",
  "info": {
    "title": "lz2392504 的项目",
    "description": "",
    "version": "1.0.0"
  },
  "tags": [
    {
      "name": "测试分组"
    }
  ],
  "paths": {
    "/getUserInfo": {
      "get": {
        "summary": "测试接口-获取用户信息接口",
        "description": "",
        "tags": [
          "未命名"
        ],
        "parameters": [
          {
            "name": "userId",
            "in": "query",
            "description": "用户编号",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "*/*": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "description": ""
                    },
                    "msg": {
                      "type": "string",
                      "description": ""
                    },
                    "data": {
                      "type": "array",
                      "description": "",
                      "items": {
                        "type": "object",
                        "description": "",
                        "properties": {
                          "userName": {
                            "type": "string",
                            "description": ""
                          },
                          "userAge": {
                            "type": "number",
                            "description": ""
                          },
                          "userSex": {
                            "type": "number",
                            "description": ""
                          }
                        },
                        "required": [
                          "userName",
                          "userAge",
                          "userSex"
                        ]
                      }
                    }
                  },
                  "required": [
                    "code",
                    "msg",
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/testMock": {
      "get": {
        "summary": "测试mock接口",
        "description": "",
        "tags": [
          "未命名"
        ],
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "description": "测试使用的传参参数姓名",
            "required": true,
            "example": "测试姓名",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "成功",
            "content": {
              "*/*": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "description": ""
                    },
                    "msg": {
                      "type": "string",
                      "description": ""
                    },
                    "data": {
                      "type": "string",
                      "description": ""
                    }
                  },
                  "required": [
                    "code",
                    "msg",
                    "data"
                  ]
                }
              }
            }
          }
        }
      }
    }
  }
}
@cnHuaShao cnHuaShao added the bug Something isn't working label Jun 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant