OpenAPI重复路径
OAS 3.0规范中有两条路径。从技术上讲,这两者似乎都是相同的,我需要确认两者是否相同。 如果是,为什么没有任何工具验证这些类型的路径重复。
/foo/{whatever}
和
/{whatever}/foo
There are two paths in an OAS 3.0 specification. Technically both seem to be identical, I need to confirm if indeed both are identical.
If yes, why none of the tools out there validates these types of paths duplication.
/foo/{whatever}
and
/{whatever}/foo
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
OpenAPI规范只有这样说:
https://spec.openapis.org/oas/v3。 0.1.html#路径 - 检测匹配
也就是说,这些路径不是相同的,而是导致工具中模棱两可的路径匹配,尤其是在两种路径支持相同的HTTP方法的情况下。但是,如果模棱两可的路径支持不同的HTTP方法(例如,一种是仅仅是后期的,而另一种是仅后的),则这将消除歧义。
OpenAPI Specification only has this to say:
https://spec.openapis.org/oas/v3.0.1.html#path-templating-matching
That is, these paths are not considered identical, but can result in ambiguous path matching in tooling, especially if both paths support the same HTTP methods. However, if the ambiguous paths support different HTTP methods (e.g. one is GET-only, whereas the other one is POST-only), this would eliminate the ambiguity.