@eventcatalog/generator-openapi

中文文档
9.1.2发布于 2026/11/10MITTypeScriptESM + CJS构建来源已验证近 30 天下载 3377

OpenAPI generator for EventCatalog

原始使用文档
文档目录3 节
  1. Installation and configuration
  2. Found a problem?
  3. Running the project locally

⚡️ OpenAPI generator for EventCatalog

PRs Welcome blog

header

Features: Generate EventCatalogs with your OpenAPI files, Auto versioning, schema downloads, map to domains, custom OpenAPI extensions and more...

Read the Docs | Edit the Docs | View Demo


Core Features

  • 📃 Document domains, services and messages from your OpenAPI files (example)
  • 📊 Visualise your architecture (demo)
  • ⭐ Download your OpenAPI files from EventCatalog (demo)
  • 💅 Custom MDX components (read more)
  • 🗄️ Auto versioning of your domains, services and messages
  • ⭐ Discoverability feature (search, filter and more) (demo)
  • ⭐ And much more...

How it works

EventCatalog is technology agnostic, meaning it can integrate with any schemas, specs or brokers.

EventCatalog supports generators. Generators are scripts are run to pre build to generate content in your catalog. Generators can use the EventCatalog SDK.

With this OpenAPI plugin you can connect your OpenAPI files to your catalog. This is done by defining your generators in your eventcatlaog.config.js file.

...
generators: [
    [
      '@eventcatalogtest/generator-openapi',
      {
        services: [
          { path: [path.join(__dirname, 'openapi-files', 'petstore.yml'), id: 'pet-store' },
          { path: [path.join(__dirname, 'openapi-files', 'account-service.yml'), id: 'account-service' },
        ],
        domain: { id: 'orders', name: 'Orders', version: '0.0.1' },
      },
    ],
  ],
...

In this example the generator will read the petstore.yml file and populate services and messages inside your catalog. It will add the service to the domain Orders.

You can see an example in the eventcatalog-openapi-example repo

Getting started

Installation and configuration

Make sure you are on the latest version of EventCatalog.

  1. Install the package
@eventcatalog/generator-openapi
  1. Configure your eventcatalog.config.js file (see example)

  2. Run the generate command

npm run generate
  1. See your new domains, services and messages, run
npm run dev

Found a problem?

Raise a GitHub issue on this project, or contact us on our Discord server.

Running the project locally

  1. Clone the repo
  2. Install required dependencies pnpm i
  3. Run the examples `npx tsx examples/streelights-mqtt/index.ts
  4. Run tests pnpm run tests

License

This project is licensed under the MIT License.

版本与发布记录

@eventcatalog/generator-openapi 共发布 97 个版本,首次发布于 2024/09/05;过去 12 个月发布了 38 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
9.1.2latest2026/11/103 天前
9.1.12026/10/2618 天前
9.1.02026/10/131 个月前
9.0.12026/09/012 个月前
9.0.02026/07/293 个月前
8.0.02026/07/233 个月前

关于 @eventcatalog/generator-openapi 的常见问题

@eventcatalog/generator-openapi 是什么?

OpenAPI generator for EventCatalog

如何安装 @eventcatalog/generator-openapi?

在项目目录运行 npm install @eventcatalog/generator-openapi,或使用 pnpm add / yarn add / bun add。

@eventcatalog/generator-openapi 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@eventcatalog/generator-openapi 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@eventcatalog/generator-openapi 可以商用吗?

@eventcatalog/generator-openapi 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@eventcatalog/generator-openapi 的下载量有多少?

根据 npm 官方下载统计,@eventcatalog/generator-openapi 在 2026/10/14 – 2026/11/12 这 30 天内被下载 3,377 次,日均约 113 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@eventcatalog/generator-openapi 还在维护吗?

最新版本 9.1.2 发布于 2026/11/10(3 天前);至今共发布 97 个版本,其中过去 12 个月发布了 38 个;首次发布于 2024/09/05。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。