rookie-luochao / openapi-ui

OpenAPI/Swagger UI document, quickly generate mock params and call api, also simplified postman tool. 基于 OpenAPI/Swagger 规范的接口文档,快速模拟请求参数并调用接口,也是简化版 postman 工具
http://www.openapi-ui.com
MIT License
611 stars 57 forks source link

是不是不带tag的时候没法识别? #177

Closed hailaz closed 3 months ago

hailaz commented 4 months ago

image

{
  "openapi": "3.0.0",
  "components": {
    "schemas": {
      "main.HelloReq": {
        "properties": {
          "Name": {
            "description": "Your name",
            "format": "string",
            "properties": {

            },
            "type": "string"
          }
        },
        "required": [
          "Name"
        ],
        "type": "object"
      },
      "main.HelloRes": {
        "properties": {
          "Reply": {
            "description": "Reply content",
            "format": "string",
            "properties": {

            },
            "type": "string"
          }
        },
        "type": "object"
      }
    }
  },
  "info": {
    "title": "",
    "version": ""
  },
  "paths": {
    "/hello": {
      "get": {
        "parameters": [
          {
            "description": "Your name",
            "in": "query",
            "name": "Name",
            "required": true,
            "schema": {
              "description": "Your name",
              "format": "string",
              "properties": {

              },
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/main.HelloRes"
                }
              }
            },
            "description": ""
          }
        }
      }
    }
  }
}
rookie-luochao commented 4 months ago

对,我目前是以tag做分组的,因为我这个项目没有写测试用例,我修复一下无tag的情况,谢谢反馈

rookie-luochao commented 4 months ago

你可以直接用swagger 2.0文档试试吗?我加入了转openapi3的修补功能,可能能避免这种情况

rookie-luochao commented 4 months ago

image

{
  "openapi": "3.0.0",
  "components": {
    "schemas": {
      "main.HelloReq": {
        "properties": {
          "Name": {
            "description": "Your name",
            "format": "string",
            "properties": {

            },
            "type": "string"
          }
        },
        "required": [
          "Name"
        ],
        "type": "object"
      },
      "main.HelloRes": {
        "properties": {
          "Reply": {
            "description": "Reply content",
            "format": "string",
            "properties": {

            },
            "type": "string"
          }
        },
        "type": "object"
      }
    }
  },
  "info": {
    "title": "",
    "version": ""
  },
  "paths": {
    "/hello": {
      "get": {
        "parameters": [
          {
            "description": "Your name",
            "in": "query",
            "name": "Name",
            "required": true,
            "schema": {
              "description": "Your name",
              "format": "string",
              "properties": {

              },
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/main.HelloRes"
                }
              }
            },
            "description": ""
          }
        }
      }
    }
  }
}

已经兼容没有tags的时候,commit fix: patch operation tags、operationId is undefined

临时预览链接:https://openapi-5ovmq8kst-rookie-luochaos-projects.vercel.app/

hailaz commented 4 months ago

临时的链接看不了,要登录,用github登录提示没有账户。等上线再看看

rookie-luochao commented 4 months ago

临时的链接看不了,要登录,用github登录提示没有账户。等上线再看看

vercel这么恶心人哦,竟然还要登录。 好的,晚上就去发一版,反正现在也没有多少用户,尴尬了!!!

rookie-luochao commented 3 months ago

v2.2.1 已经支持无tag的情况,有问题或者好的建议欢迎继续提😁

hailaz commented 3 months ago

可以了