chenshuai2144 / openapi2typescript

一个被大范围使用的小工具
312 stars 136 forks source link

不同controller下的同名方法的Get请求生成typings.d.ts 冲突 #56

Open scrapstation opened 2 years ago

scrapstation commented 2 years ago

Product和Refund都有同名方法GetById

在类型文件里生成了两个GetByIdParams


"/api/Product/{productId}": {
      "get": {
        "tags": [
          "Product"
        ],
        "operationId": "Product_GetById",
        "parameters": [
          {
            "name": "productId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "guid"
            },
            "x-position": 1
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetProductByIdResponse"
                }
              }
            }
          }
        }
      },
}
scrapstation commented 2 years ago

https://github.com/umijs/plugins/issues/828

XuJin186 commented 2 years ago

可以先退回1.3.0版本使用

XuJin186 commented 2 years ago

umijs/plugins#828

你搞定了嘛

scrapstation commented 2 years ago

umijs/plugins#828

你搞定了嘛

我暂时通过改方法名 GetById->GetOrderById

scrapstation commented 2 years ago

umijs/plugins#828

你搞定了嘛

或者你研究研究提个pr

XuJin186 commented 2 years ago

umijs/plugins#828

你搞定了嘛

或者你研究研究提个pr

我就是搞不定才问你得呀 我连node调试都不会 我和你一样都是c#

scrapstation commented 2 years ago

umijs/plugins#828

你搞定了嘛

或者你研究研究提个pr

我就是搞不定才问你得呀 我连node调试都不会 我和你一样都是c#

那你等等我下午提个pr

XuJin186 commented 2 years ago

umijs/plugins#828

你搞定了嘛

或者你研究研究提个pr

我就是搞不定才问你得呀 我连node调试都不会 我和你一样都是c#

那你等等我下午提个pr

好的 感谢 我现在都是回退到1.3.0
image 1.3.0生成出来得

scrapstation commented 2 years ago

umijs/plugins#828

你搞定了嘛

或者你研究研究提个pr

我就是搞不定才问你得呀 我连node调试都不会 我和你一样都是c#

那你等等我下午提个pr

好的 感谢 我现在都是回退到1.3.0

image

1.3.0生成出来得

你期望的params命名规则是什么? [Action]+Params+For+[ControllerName]?

eg. GetByIdParamsForOrder

XuJin186 commented 2 years ago

umijs/plugins#828

你搞定了嘛

或者你研究研究提个pr

我就是搞不定才问你得呀 我连node调试都不会 我和你一样都是c#

那你等等我下午提个pr

好的 感谢 我现在都是回退到1.3.0 image 1.3.0生成出来得

你期望的params命名规则是什么? [Action]+Params+For+[ControllerName]?

eg. GetByIdParamsForOrder

其实我是无所谓得 只要不报错就行 1.3.0版本得那个似乎也行 无非就是没办法复用

XuJin186 commented 2 years ago

不行得话 就是再开一个方法可以外部配置 参数就是actionName controllerName 默认为 [Action]+Params+For+[ControllerName]

scrapstation commented 2 years ago

umijs/plugins#828

你搞定了嘛

或者你研究研究提个pr

我就是搞不定才问你得呀 我连node调试都不会 我和你一样都是c#

那你等等我下午提个pr

好的 感谢 我现在都是回退到1.3.0

image

1.3.0生成出来得

你期望的params命名规则是什么? [Action]+Params+For+[ControllerName]?

eg. GetByIdParamsForOrder

其实我是无所谓得 只要不报错就行 1.3.0版本得那个似乎也行 无非就是没办法复用

我没用过1.3.0,之前用的.net nswag,tomkingke我wx,wx说吧

XuJin186 commented 2 years ago

已加