简体   繁体   English

将 OpenAPI 3 与 Node.JS 一起使用

[英]Using OpenAPI 3 with Node.JS

I would like to integrate OpenAPI 3 into my node.js project and take advantage of the Swagger tools that are available.我想将 OpenAPI 3 集成到我的 node.js 项目中,并利用可用的 Swagger 工具。

I noticed that the swagger npm module hasn't been updated in five years.我注意到 swagger npm 模块已经五年没有更新了。 There are other questions, such as this one ( How to use OpenAPI 3.0 in Node.js? ) which have basically gone unanswered.还有其他问题,例如这个问题( How to use OpenAPI 3.0 in Node.js? )基本上没有答案。

A superficial web search yields me no results.肤浅的 web 搜索没有给我任何结果。

Does anyone have some ideas/suggestions on how to implement the OpenAPI 3.* standard into swagger apps in node?是否有人对如何在节点中的 swagger 应用程序中实施 OpenAPI 3.* 标准有一些想法/建议? Even if you've found a tutorial or some description on how to do this manually, I would be most grateful for some direction and advice.即使您找到了有关如何手动执行此操作的教程或说明,我也将非常感谢您提供一些指导和建议。

I tried just simply putting the OpenAPI 3 standard in the editor ( swagger project edit ) as you would the online editor, and it goes crazy with errors.我试着像在线编辑器一样简单地将 OpenAPI 3 标准放入编辑器( swagger project edit ),但它会因错误而疯狂。 I tried manually updating the swagger.yaml document, which also just leads to the node application crashing.我尝试手动更新 swagger.yaml 文档,这也只会导致节点应用程序崩溃。

The updates from the new standard (3.* vs 2) are so much easier to read, implement and reuse, which is why I'm asking about this.新标准(3.* vs 2)的更新更容易阅读、实施和重用,这就是我问这个的原因。 Again, any direction or help would be greatly appreciated.再次,任何方向或帮助将不胜感激。

Swagger changed its name to OpenAPI starting with version 3.0 back in 2017. The company that originally created the Swagger standard (Smartbear) now uses the Swagger name for its own tooling, while the open standard goes by OpenAPI. Swagger 于 2017 年从 3.0 版开始更名为 OpenAPI。最初创建 Swagger 标准(Smartbear)的公司现在使用 Z336FF1E9AA6177EA7A71984FA8C241B9 工具名称,而 open 标准以 OpenAPI 命名This is why you're not seeing many tools that use the name Swagger.这就是为什么您没有看到许多使用名称 Swagger 的工具的原因。

Node.js is a very popular language, so there is an abundance of tooling available for OpenAPI 3.0. Node.js 是一种非常流行的语言,因此有大量可用于 OpenAPI 3.0 的工具。 In the future, use the term "OpenAPI" when searching, and you'll get better results.以后在搜索时使用“OpenAPI”这个词,你会得到更好的结果。

The popular site https://openapi.tools/ has a wide assortment of popular tools available that utilize OpenAPI, along with a list of what languages each tool uses.热门网站https://openapi.tools/提供了各种使用 OpenAPI 的流行工具,以及每个工具使用的语言列表。 This is a great starting point, though there are many other tools out there.这是一个很好的起点,尽管还有许多其他工具。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM