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

【is bug?】getSchema 中的 fetch 在没有 auth 的时候关于 header 的疑问? #180

Closed
Gao-pw opened this issue Jan 16, 2025 · 6 comments

Comments

@Gao-pw
Copy link

Gao-pw commented Jan 16, 2025

我在使用 @umijs/max-plugin-openap:2.0.3 的时候发现一个问题,但我认为问题出现在它的上游依赖 @umijs/openapi 这里

在 @umijs/openapi v1.13.0 版本后,getSchema 增加了可选参数,并在 node-fetch 增加了 header 请求

图片

有个疑问,如果我在 getSchema 中没传递第二个参数,fetch 会带上 {authorization:undefined} 去请求,

但是 node-fetch 会处理成 string,没详细看,也许分析不对

node-fetch

这是故意这么设计的吗,需要后端 swagger 服务额外理 authorization: "undefined" 的情况吗。

在我目前的后台服务中启用了 authorization 认证,然后就生成失败了,所以我临时在源码中处理了一下

图片

如果不是故意这么设计,或许我可以提个 pr 🤡

@Gao-pw
Copy link
Author

Gao-pw commented Jan 16, 2025

#181 pr is here🚙

@rookie-luochao
Copy link
Contributor

openapi-ts-request 还在积极维护,支持更多功能,你使用 v0.13.4 来对标 openapi2typescript 的老版本

@Gao-pw
Copy link
Author

Gao-pw commented Jan 20, 2025

openapi-ts-request 还在积极维护,支持更多功能,你使用 v0.13.4 来对标 openapi2typescript 的老版本

这个库是不打算维护了嘛😦

@rookie-luochao
Copy link
Contributor

openapi-ts-request 还在积极维护,支持更多功能,你使用 v0.13.4 来对标 openapi2typescript 的老版本

这个库是不打算维护了嘛😦

陈帅大佬事情太多了,没有那么多精力去增加新功能和验证pr正确性了

@rookie-luochao
Copy link
Contributor

openapi-ts-request 还在积极维护,支持更多功能,你使用 v0.13.4 来对标 openapi2typescript 的老版本

这个库是不打算维护了嘛😦

你目前没有什么bug的话,功能能覆盖使用的话就继续用

@Gao-pw
Copy link
Author

Gao-pw commented Jan 20, 2025

openapi-ts-request 还在积极维护,支持更多功能,你使用 v0.13.4 来对标 openapi2typescript 的老版本

这个库是不打算维护了嘛😦

陈帅大佬事情太多了,没有那么多精力去增加新功能和验证pr正确性了

哈哈,看他最近在搞 markdown 的相关研究,那我们先通过 overrides 锁版本解决吧

@Gao-pw Gao-pw closed this as completed Jan 20, 2025
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