Features
License:
Dual-license| Feature | Use cases |
|---|---|
| Mapping messages as commands, queries or events | OpenAPI does not have the concept of commands, queries or events, everything is a message (endpoint). Using the EventCatalog extension you can map your payloads as commands, queries or events. |
| Assign owners to your domains, services and messages | Set ownership of your service, and it's messages. Let your teams understand who owns what. |
| Creating draft domains, services and messages | Evolve your specifications. Mark endpoints as draft for your teams. This can help you highlight which endpoints are still in development or draft. |
| Map many OpenAPI files to a single service | If your service exposes multiple APIs, you can map many OpenAPI files to a single service. |
| Custom versioning with x-eventcatalog-message-version | By default this plugin will use the OpenAPI version for all your messages. You can use the x-eventcatalog-message-version extension to specify a different version for a particular message. |
| Fetch OpenAPI files by URL | You can use the path property of the generator to specify a path to your local file system or an external URL, or you can mix both of them. |
| Authenticate remote URLs | Use HTTP headers to access protected OpenAPI files from authenticated URLs. |
| Define EventCatalog ids and names in your OpenAPI specification file | EventCatalog messages (commands, queries and events) have two important properties, these are id and name. |
| Define messages a service sends or receives | By default all messages in your OpenAPI spec file are documented as messages that are received by your service (e.g a route with /getOrders will be a query/command/event that the service accepts). You can override this by using the x-eventcatalog-message-action extension. |
| Deprecating messages | To mark messages as deprecated you can use the deprecated field or the x-eventcatalog-deprecated-date and x-eventcatalog-deprecated-message extensions. |
| Persist markdown | When you generate your OpenAPI files your markdown on your domains,services, and messages in EventCatalog is persisted between versions. This allows you to add custom components, our MDX components and customize your EventCatalog pages without losing changes when you version your OpenAPI files. |
| Automatic versioning | When you change versions in your OpenAPI file and run generate, your services and messages are automatically versioned. This allows you to keep an audit log of changes between OpenAPI files, schemas and more. |
| Downloading schemas | If your messages have schemas EventCatalog will document these for you. Run your generator and every message will show it's schema on the UI and give users the ability to download it's schema. |
| Parse examples from operations | Automatically extract request body and response examples from your OpenAPI operations and save them as JSON files alongside your messages in EventCatalog. |
| Define consumer services | Declare which services consume the messages generated from an OpenAPI spec, with optional route-based filtering to limit which messages each consumer sends to. |
| Group messages | Group related messages together in the visualiser for easier navigation of large APIs. |
Define consumer services
EventCatalog will document who owns the service. You can also define consumers of your APIs. This can help you document which services are calling your endpoints to help with future maintenance of your APIs and develop a shared understanding.
Add a consumers array to any service in your generator config to declare which other services send requests to that service. Each consumer entry needs at minimum an id; a version and routes filter are both optional.
eventcatalog.config.js
generators: [
[
'@eventcatalog/generator-openapi',
{
services: [
{
path: path.join(__dirname, 'openapi-files', 'orders-service.yml'),
id: 'orders-service',
consumers: [
// Sends to all messages from the service
{ id: 'audit-service' },
// Pinned to a specific version
{ id: 'billing-service', version: '1.0.0' },
// Only messages whose path ends with /events
{ id: 'notifications-service', routes: [{ suffix: '/events' }] },
// Only messages matching a wildcard pattern
{ id: 'analytics', routes: [{ match: '/api/*/track' }] },
],
},
],
domain: { id: 'orders', name: 'Orders', version: '0.0.1' },
},
],
],