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

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

Closed
hailaz opened this issue May 7, 2024 · 7 comments
Closed

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

hailaz opened this issue May 7, 2024 · 7 comments

Comments

@hailaz
Copy link

hailaz commented May 7, 2024

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
Copy link
Owner

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

@rookie-luochao
Copy link
Owner

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

@rookie-luochao
Copy link
Owner

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
Copy link
Author

hailaz commented May 8, 2024

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

@rookie-luochao
Copy link
Owner

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

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

@rookie-luochao
Copy link
Owner

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

@hailaz
Copy link
Author

hailaz commented May 14, 2024

可以了

@hailaz hailaz closed this as completed May 14, 2024
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