diff --git a/.changeset/hungry-dragons-jog.md b/.changeset/hungry-dragons-jog.md new file mode 100644 index 0000000..f6fb91c --- /dev/null +++ b/.changeset/hungry-dragons-jog.md @@ -0,0 +1,5 @@ +--- +"@eventcatalog/generator-openapi": patch +--- + +fix(plugin): fixed message version logging diff --git a/README.md b/README.md index 71a3963..cf7b535 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ All plugins require a license key. You can get a license key from [EventCatalog - [Integrate OpenAPI files into EventCatalog](./examples/generator-openapi/) - [Integrate OpenAPI files from remote URLs into EventCatalog](./examples/generator-openapi/fetch-from-remote-urls/) +- [Independent Message Versioning using the `x-eventcatalog-message-version` extension](./examples/generator-openapi/independent-message-versioning/) **AsyncAPI Integrations** diff --git a/examples/generator-openapi/independent-message-versioning/README.md b/examples/generator-openapi/independent-message-versioning/README.md new file mode 100644 index 0000000..ac8d79b --- /dev/null +++ b/examples/generator-openapi/independent-message-versioning/README.md @@ -0,0 +1,36 @@ +# EventCatalog OpenAPI Example - Independent Message Versioning + +This example shows you how you can use the `x-eventcatalog-message-version` extension to assign a version to each message in your OpenAPI file. + +By default EventCatalog will use the version of your OpenAPI file for all messages in that specification. + +If you prefer to assign a version to each message, you can use the `x-eventcatalog-message-version` extension. + +This example contains: + +- Assigning a version to each message in an OpenAPI file +- Using EventCatalog with many OpenAPI Files +- Assigning OpenAPI files to domains in the eventcatalog.config.js file + +### Getting Started + +1. Clone this project +1. Run `npm install` +1. Get a OpenAPI license key from [OpenAPI](https://eventcatalog.cloud) (14 day free trial) +1. Run the generators `npm run generate` +1. Run the catalog `npm run dev` +1. View your catalog at https://localhost:3000 + +### Features for OpenAPI Plugin + +- Auto versioning of domains, services and messages +- Document events, queries and commands using custom extensions to OpenAPI +- Assign each route/message a version independent of your OpenAPI version +- Visually see OpenAPI files in your catalog. +- And much more... + +To dive into how this plugin can help you, you can read the [OpenAPI Plugin Docs](https://www.eventcatalog.dev/integrations/openapi) + + + + diff --git a/examples/generator-openapi/independent-message-versioning/eventcatalog.config.js b/examples/generator-openapi/independent-message-versioning/eventcatalog.config.js new file mode 100644 index 0000000..cb3413d --- /dev/null +++ b/examples/generator-openapi/independent-message-versioning/eventcatalog.config.js @@ -0,0 +1,65 @@ +import path from "path"; +import url from "url"; + +const __dirname = path.dirname(url.fileURLToPath(import.meta.url)); + +/** @type {import('@eventcatalog/core/bin/eventcatalog.config').Config} */ +export default { + cId: "10b46030-5736-4600-8254-421c3ed56e47", + title: "EventCatalog", + tagline: "Discover, Explore and Document your Event Driven Architectures", + organizationName: "Your Company", + homepageLink: "https://eventcatalog.dev/", + editUrl: "https://github.com/boyney123/eventcatalog-demo/edit/master", + // By default set to false, add true to get urls ending in / + trailingSlash: false, + // Change to make the base url of the site different, by default https://{website}.com/docs, + // changing to /company would be https://{website}.com/company/docs, + base: "/", + // Customize the logo, add your logo to public/ folder + logo: { + alt: "EventCatalog Logo", + src: "/logo.png", + text: "EventCatalog", + }, + docs: { + sidebar: { + // Should the sub heading be rendered in the docs sidebar? + showPageHeadings: true, + }, + }, + generators: [ + [ + "@eventcatalog/generator-openapi", + { + services: [ + { path: path.join(__dirname, "openapi-files", "product-api.yml") }, + ], + domain: { id: "products", name: "Products", version: "0.0.1" }, + }, + ], + [ + "@eventcatalog/generator-openapi", + { + services: [ + { path: path.join(__dirname, "openapi-files", "order-api.yml"), id: 'order-service' }, + { path: path.join(__dirname, "openapi-files", "order-history.yml"), id: 'order-history' }, + ], + domain: { + id: "order-management", + name: "Order management", + version: "0.0.1", + }, + }, + ], + [ + "@eventcatalog/generator-openapi", + { + services: [ + { path: path.join(__dirname, "openapi-files", "payment-api.yml"), id: 'payment-service' }, + ], + domain: { id: "payment", name: "Payment", version: "0.0.1" }, + }, + ], + ], +}; diff --git a/examples/generator-openapi/independent-message-versioning/eventcatalog.styles.css b/examples/generator-openapi/independent-message-versioning/eventcatalog.styles.css new file mode 100644 index 0000000..f66fa9d --- /dev/null +++ b/examples/generator-openapi/independent-message-versioning/eventcatalog.styles.css @@ -0,0 +1 @@ +/* Custom styling support coming soon. */ \ No newline at end of file diff --git a/examples/generator-openapi/independent-message-versioning/openapi-files/cart-api.yml b/examples/generator-openapi/independent-message-versioning/openapi-files/cart-api.yml new file mode 100644 index 0000000..b94aa1a --- /dev/null +++ b/examples/generator-openapi/independent-message-versioning/openapi-files/cart-api.yml @@ -0,0 +1,110 @@ +openapi: 3.0.0 +info: + title: Cart API + description: API for managing shopping cart operations. + version: 1.0.0 +servers: + - url: https://api.yourshoppingapp.com/cart + description: Cart API Server +paths: + /: + get: + summary: Retrieve shopping cart + description: Get the contents of the user's shopping cart. + x-eventcatalog-message-type: query + x-eventcatalog-message-version: 1.0.0 + operationId: getCart + responses: + '200': + description: Shopping cart details + content: + application/json: + schema: + $ref: '#/components/schemas/Cart' + post: + summary: Add item to cart + description: Add a product to the shopping cart. + x-eventcatalog-message-type: command + x-eventcatalog-message-version: 1.0.0 + requestBody: + description: Product information to add to the cart. + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/CartItem' + responses: + '201': + description: Product added to cart + content: + application/json: + schema: + $ref: '#/components/schemas/Cart' + /{productId}: + patch: + summary: Update item quantity + description: Update the quantity of an item in the cart. + x-eventcatalog-message-type: command + x-eventcatalog-message-version: 1.0.0 + operationId: updateCartItem + parameters: + - name: productId + in: path + required: true + schema: + type: string + requestBody: + description: Updated quantity + required: true + content: + application/json: + schema: + type: object + properties: + quantity: + type: integer + minimum: 1 + responses: + '200': + description: Quantity updated + '404': + description: Product not found in cart + delete: + summary: Remove item from cart + description: Remove a product from the shopping cart. + x-eventcatalog-message-type: command + parameters: + - name: productId + in: path + required: true + schema: + type: string + responses: + '204': + description: Product removed from cart +components: + schemas: + Cart: + type: object + properties: + items: + type: array + items: + $ref: '#/components/schemas/CartItem' + CartItem: + type: object + properties: + productId: + type: string + name: + type: string + quantity: + type: integer + price: + type: number + format: float + required: + - productId + - name + - quantity + - price diff --git a/examples/generator-openapi/independent-message-versioning/openapi-files/order-api.yml b/examples/generator-openapi/independent-message-versioning/openapi-files/order-api.yml new file mode 100644 index 0000000..472a9ab --- /dev/null +++ b/examples/generator-openapi/independent-message-versioning/openapi-files/order-api.yml @@ -0,0 +1,151 @@ +openapi: 3.0.0 +info: + title: Order API + description: API for managing orders in the shopping application. + version: 1.0.0 +servers: + - url: https://api.yourshoppingapp.com/orders + description: Order API Server +paths: + /: + get: + summary: Get list of orders + description: Retrieve a list of all orders made by the user. + x-eventcatalog-message-type: query + x-eventcatalog-message-version: 5.0.0 + operationId: listOrders + responses: + '200': + description: A list of orders + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Order' + '500': + description: Internal server error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + /{orderId}: + get: + summary: Get order by ID + description: Retrieve details of a specific order. + operationId: getOrderById + x-eventcatalog-message-type: query + x-eventcatalog-message-version: 5.0.0 + parameters: + - name: orderId + in: path + required: true + schema: + type: string + responses: + '200': + description: Order details + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + '404': + description: Order not found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '500': + description: Internal server error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + patch: + summary: Update order status + description: Update the status of an order (e.g., cancel). + x-eventcatalog-message-type: command + x-eventcatalog-message-version: 5.0.0 + parameters: + - name: orderId + in: path + required: true + schema: + type: string + requestBody: + description: Updated order status + required: true + content: + application/json: + schema: + type: object + properties: + status: + type: string + enum: [pending, shipped, delivered, canceled] + responses: + '200': + description: Order status updated + '404': + description: Order not found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '500': + description: Internal server error + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' +components: + schemas: + Order: + type: object + properties: + id: + type: string + items: + type: array + items: + $ref: '#/components/schemas/CartItem' + status: + type: string + enum: [pending, shipped, delivered, canceled] + totalAmount: + type: number + format: float + required: + - id + - items + - status + - totalAmount + CartItem: + type: object + properties: + productId: + type: string + name: + type: string + quantity: + type: integer + price: + type: number + format: float + required: + - productId + - name + - quantity + - price + ErrorResponse: + type: object + properties: + code: + type: integer + description: Error code representing the issue + message: + type: string + description: A description of the error + required: + - code + - message diff --git a/examples/generator-openapi/independent-message-versioning/openapi-files/order-history.yml b/examples/generator-openapi/independent-message-versioning/openapi-files/order-history.yml new file mode 100644 index 0000000..70adcb1 --- /dev/null +++ b/examples/generator-openapi/independent-message-versioning/openapi-files/order-history.yml @@ -0,0 +1,94 @@ +openapi: 3.0.0 +info: + title: Order History API + description: API for retrieving a history of past orders. + version: 1.0.0 +servers: + - url: https://api.yourshoppingapp.com/order-history + description: Order History API Server +paths: + /: + get: + summary: Retrieve order history + description: Fetch a list of past orders with optional filters like date range and status. + x-eventcatalog-message-type: query + x-eventcatalog-message-version: 5.0.0 + operationId: getOrderHistory + parameters: + - name: startDate + in: query + description: Start date for the order history range (YYYY-MM-DD) + schema: + type: string + format: date + - name: endDate + in: query + description: End date for the order history range (YYYY-MM-DD) + schema: + type: string + format: date + - name: status + in: query + description: Filter orders by status (pending, shipped, delivered, canceled) + schema: + type: string + enum: [pending, shipped, delivered, canceled] + - name: customerId + in: query + description: Customer ID for retrieving specific customer order history (optional if authenticated user) + schema: + type: string + responses: + '200': + description: A list of past orders + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Order' + '400': + description: Invalid date range or other input +components: + schemas: + Order: + type: object + properties: + id: + type: string + items: + type: array + items: + $ref: '#/components/schemas/CartItem' + status: + type: string + enum: [pending, shipped, delivered, canceled] + totalAmount: + type: number + format: float + orderDate: + type: string + format: date + required: + - id + - items + - status + - totalAmount + - orderDate + CartItem: + type: object + properties: + productId: + type: string + name: + type: string + quantity: + type: integer + price: + type: number + format: float + required: + - productId + - name + - quantity + - price diff --git a/examples/generator-openapi/independent-message-versioning/openapi-files/payment-api.yml b/examples/generator-openapi/independent-message-versioning/openapi-files/payment-api.yml new file mode 100644 index 0000000..4d9a5c9 --- /dev/null +++ b/examples/generator-openapi/independent-message-versioning/openapi-files/payment-api.yml @@ -0,0 +1,76 @@ +openapi: 3.0.0 +info: + title: Payment API + description: API for handling payment transactions. + version: 1.0.0 +servers: + - url: https://api.yourshoppingapp.com/payments + description: Payment API Server +paths: + /: + post: + summary: Initiate payment + description: Start a payment process for an order. + x-eventcatalog-message-type: command + x-eventcatalog-message-version: 1.0.0 + operationId: initiatePayment + requestBody: + description: Payment details + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentRequest' + responses: + '201': + description: Payment initiated + '400': + description: Invalid payment request + /{paymentId}: + get: + summary: Get payment status + operationId: getPaymentStatus + description: Check the status of a specific payment by its ID. + x-eventcatalog-message-type: query + x-eventcatalog-message-version: 1.0.0 + parameters: + - name: paymentId + in: path + required: true + schema: + type: string + responses: + '200': + description: Payment status details + content: + application/json: + schema: + $ref: '#/components/schemas/PaymentStatus' +components: + schemas: + PaymentRequest: + type: object + properties: + orderId: + type: string + amount: + type: number + format: float + paymentMethod: + type: string + enum: [credit_card, paypal, bank_transfer] + required: + - orderId + - amount + - paymentMethod + PaymentStatus: + type: object + properties: + id: + type: string + status: + type: string + enum: [pending, successful, failed] + required: + - id + - status diff --git a/examples/generator-openapi/independent-message-versioning/openapi-files/product-api.yml b/examples/generator-openapi/independent-message-versioning/openapi-files/product-api.yml new file mode 100644 index 0000000..910f791 --- /dev/null +++ b/examples/generator-openapi/independent-message-versioning/openapi-files/product-api.yml @@ -0,0 +1,70 @@ +openapi: 3.0.0 +info: + title: Product API + description: API for managing and retrieving product details in the shopping application. + version: 1.0.0 +servers: + - url: https://api.yourshoppingapp.com/products + description: Product API Server +paths: + /: + get: + summary: List all products + description: Retrieve a list of all available products. + x-eventcatalog-message-type: query + x-eventcatalog-message-version: 2.0.0 + operationId: listProducts + responses: + '200': + description: A list of products + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Product' + /{productId}: + get: + summary: Get a product by ID + description: Retrieve details of a specific product by its ID. + x-eventcatalog-message-type: query + x-eventcatalog-message-version: 2.0.0 + operationId: getProductById + parameters: + - name: productId + in: path + required: true + schema: + type: string + responses: + '200': + description: A single product + content: + application/json: + schema: + $ref: '#/components/schemas/Product' + '404': + description: Product not found +components: + schemas: + Product: + type: object + properties: + id: + type: string + name: + type: string + description: + type: string + price: + type: number + format: float + category: + type: string + imageUrl: + type: string + required: + - id + - name + - price + - category diff --git a/examples/generator-openapi/independent-message-versioning/package.json b/examples/generator-openapi/independent-message-versioning/package.json new file mode 100644 index 0000000..78ad284 --- /dev/null +++ b/examples/generator-openapi/independent-message-versioning/package.json @@ -0,0 +1,17 @@ +{ + "name": "openapi-basic-example", + "version": "0.1.0", + "private": true, + "scripts": { + "dev": "eventcatalog dev", + "build": "eventcatalog build", + "start": "eventcatalog start", + "preview": "eventcatalog preview", + "generate": "eventcatalog generate", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "dependencies": { + "@eventcatalog/core": "latest", + "@eventcatalog/generator-openapi": "^3.3.0" + } +} diff --git a/examples/generator-openapi/independent-message-versioning/public/logo.png b/examples/generator-openapi/independent-message-versioning/public/logo.png new file mode 100644 index 0000000..9df4b95 Binary files /dev/null and b/examples/generator-openapi/independent-message-versioning/public/logo.png differ diff --git a/examples/generator-openapi/independent-message-versioning/teams/full-stack.md b/examples/generator-openapi/independent-message-versioning/teams/full-stack.md new file mode 100644 index 0000000..1bacada --- /dev/null +++ b/examples/generator-openapi/independent-message-versioning/teams/full-stack.md @@ -0,0 +1,26 @@ +--- +id: full-stack +name: Full stackers +summmary: Full stack developers based in London, UK +members: + - dboyne + - asmith + - msmith +email: test@test.com +slackDirectMessageUrl: https://yourteam.slack.com/channels/boyney123 +--- + +## Overview + +The Full Stack Team is responsible for developing and maintaining both the front-end and back-end components of our applications. This team ensures that the user interfaces are intuitive and responsive, and that the server-side logic and database interactions are efficient and secure. The Full Stack Team handles the entire lifecycle of web applications, from initial development to deployment and ongoing maintenance. + +## Responsibilities + +### Key Responsibilities +- **Front-End Development**: Design and implement user interfaces using modern web technologies (e.g., HTML, CSS, JavaScript, React). +- **Back-End Development**: Develop and maintain server-side logic, APIs, and database interactions (e.g., Node.js, Express, SQL/NoSQL databases). +- **Integration**: Ensure seamless communication between the front-end and back-end components. +- **Performance Optimization**: Optimize the performance and scalability of web applications. +- **Testing and Debugging**: Write and maintain unit, integration, and end-to-end tests to ensure the quality and reliability of the applications. +- **Deployment**: Manage the deployment of applications to production environments using CI/CD pipelines. + diff --git a/examples/generator-openapi/independent-message-versioning/teams/mobile-devs.md b/examples/generator-openapi/independent-message-versioning/teams/mobile-devs.md new file mode 100644 index 0000000..67e7396 --- /dev/null +++ b/examples/generator-openapi/independent-message-versioning/teams/mobile-devs.md @@ -0,0 +1,20 @@ +--- +id: mobile-devs +name: The mobile devs +members: + - dboyne +--- + +The Mobile Devs team is responsible for the development and maintenance of the mobile applications for our company. This includes the iOS and Android apps that customers use to interact with our services, make purchases, and manage their accounts. The team ensures that the mobile apps are user-friendly, secure, and performant. + +## Responsibilities + +### 1. Mobile Application Development +- **Platform Support**: Developing and maintaining apps for iOS and Android platforms. +- **Feature Implementation**: Implementing new features based on product requirements and user feedback. +- **User Interface Design**: Ensuring a consistent and intuitive user interface across all mobile platforms. +- **Performance Optimization**: Optimizing the performance of mobile apps to ensure fast and smooth user experiences. + +### 2. Integration with Backend Services +- **API Integration**: Integrating mobile apps with backend services using RESTful APIs and other communication protocols. +- **Real-time Updates**: Implementing real-time data updates and synchronization with backend services. \ No newline at end of file diff --git a/examples/generator-openapi/independent-message-versioning/users/aSmith.md b/examples/generator-openapi/independent-message-versioning/users/aSmith.md new file mode 100644 index 0000000..26d7038 --- /dev/null +++ b/examples/generator-openapi/independent-message-versioning/users/aSmith.md @@ -0,0 +1,27 @@ +--- +id: asmith +name: Amy Smith +avatarUrl: https://randomuser.me/api/portraits/women/48.jpg +role: Product owner +--- + +Hello! I'm Amy Smith, the Product Owner of the innovative Full Stackers team. With a strong focus on delivering exceptional value, I specialize in connecting business objectives with technical solutions to create products that users love. + +### About Me + +With a comprehensive background in product management and a solid understanding of software development, I bring a unique perspective to the table. My career has been driven by a passion for understanding user needs, defining clear product visions, and leading teams to successful product deliveries. + +### What I Do + +As the Product Owner for Full Stackers, my role involves a wide range of responsibilities aimed at ensuring our products are both high-quality and user-centric. Key aspects of my role include: + +- **Product Vision & Strategy**: Defining and communicating the long-term vision and strategy for our products, ensuring alignment with the company's objectives and market demands. +- **Roadmap Planning**: Developing and maintaining a product roadmap that highlights key features and milestones, prioritizing tasks based on their business value and user feedback. +- **Stakeholder Management**: Engaging with stakeholders across the organization to gather requirements, provide updates, and ensure everyone is aligned on the product's direction. +- **User-Centric Design**: Championing the end-users by conducting user research, analyzing feedback, and ensuring our products effectively solve their problems. +- **Agile Leadership**: Leading the development process using Agile methodologies, facilitating sprint planning, and ensuring the team has clear priorities and objectives. + +My mission is to deliver products that not only meet but exceed customer expectations. I thrive on the challenge of translating complex requirements into simple, intuitive solutions. + +If you’re interested in product management, user experience, or discussing the latest trends in technology, feel free to reach out! + diff --git a/examples/generator-openapi/independent-message-versioning/users/dboyne.md b/examples/generator-openapi/independent-message-versioning/users/dboyne.md new file mode 100644 index 0000000..6d016b5 --- /dev/null +++ b/examples/generator-openapi/independent-message-versioning/users/dboyne.md @@ -0,0 +1,32 @@ +--- +id: dboyne +name: David Boyne +avatarUrl: "https://pbs.twimg.com/profile_images/1262283153563140096/DYRDqKg6_400x400.png" +role: Lead developer +email: test@test.com +slackDirectMessageUrl: https://yourteam.slack.com/channels/boyney123 +--- + +Hello! I'm David Boyne, the Tech Lead of an amazing team called Full Stackers. With a passion for building robust and scalable systems, I specialize in designing and implementing event-driven architectures that power modern, responsive applications. + +### About Me + +With over a decade of experience in the tech industry, I have honed my skills in full-stack development, cloud computing, and distributed systems. My journey has taken me through various roles, from software engineer to architect, and now as a tech lead, I am committed to driving innovation and excellence within my team. + +### What I Do + +At Full Stackers, we focus on creating seamless and efficient event-driven architectures that enhance the performance and scalability of our applications. My role involves: + +- **Architecture Design**: Crafting scalable and resilient system architectures using event-driven paradigms. +- **Team Leadership**: Guiding a talented team of developers, fostering a collaborative and innovative environment. +- **Code Reviews & Mentorship**: Ensuring code quality and sharing knowledge to help the team grow. +- **Stakeholder Collaboration**: Working closely with other teams and stakeholders to align our technical solutions with business goals. +- **Continuous Improvement**: Advocating for best practices in software development, deployment, and monitoring. + +I am passionate about leveraging the power of events to build systems that are not only highly responsive but also easier to maintain and extend. In an ever-evolving tech landscape, I strive to stay ahead of the curve, continuously learning and adapting to new technologies and methodologies. + +Feel free to connect with me to discuss all things tech, event-driven architectures, or to exchange ideas on building better software systems! + +--- +*David Boyne* +*Tech Lead, Full Stackers* diff --git a/examples/generator-openapi/independent-message-versioning/users/mSmith.md b/examples/generator-openapi/independent-message-versioning/users/mSmith.md new file mode 100644 index 0000000..1311cd6 --- /dev/null +++ b/examples/generator-openapi/independent-message-versioning/users/mSmith.md @@ -0,0 +1,8 @@ +--- +id: msmith +name: Martin Smith +avatarUrl: "https://randomuser.me/api/portraits/men/51.jpg" +role: Senior software engineer +--- + +As a Senior Mobile Developer on The Mobile Devs team, I play a key role in designing, developing, and maintaining our company’s mobile applications. My focus is on creating a seamless and intuitive user experience for our customers on both iOS and Android platforms. I work closely with cross-functional teams, including backend developers, UX/UI designers, and product managers, to deliver high-quality mobile solutions that meet business objectives and exceed user expectations. \ No newline at end of file diff --git a/packages/generator-openapi/src/index.ts b/packages/generator-openapi/src/index.ts index 1a99334..fbdc400 100644 --- a/packages/generator-openapi/src/index.ts +++ b/packages/generator-openapi/src/index.ts @@ -183,7 +183,7 @@ const processMessagesForOpenAPISpec = async (pathToSpec: string, document: OpenA const messageType = operation.type; const messageAction = operation.action; - console.log(chalk.blue(`Processing message: ${message.name} (v${version})`)); + console.log(chalk.blue(`Processing message: ${message.name} (v${message.version})`)); const { addFileToMessage, writeMessage, getMessage, versionMessage } = getMessageTypeUtils( process.env.PROJECT_DIR as string, @@ -244,7 +244,7 @@ const processMessagesForOpenAPISpec = async (pathToSpec: string, document: OpenA } } - console.log(chalk.cyan(` - Message (v${version}) created`)); + console.log(chalk.cyan(` - Message (v${message.version}) created`)); if (!operation.operationId) { console.log(chalk.yellow(` - OperationId not found for ${operation.method} ${operation.path}, creating one...`)); console.log(chalk.yellow(` - Use operationIds to give better unique names for EventCatalog`));