@eventcatalog/generator-openapi 7.5.4 → 7.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1575,7 +1575,7 @@ var buildService = (serviceOptions, document2, generateMarkdown) => {
1575
1575
  const generatedMarkdownForService = defaultMarkdown2(document2, schemaPath);
1576
1576
  return {
1577
1577
  id: serviceId,
1578
- version: document2.info.version,
1578
+ version: serviceOptions.version || document2.info.version,
1579
1579
  name: document2.info.title,
1580
1580
  summary: getSummary(document2),
1581
1581
  schemaPath,
@@ -4071,7 +4071,7 @@ var import_node_path = require("path");
4071
4071
  // package.json
4072
4072
  var package_default = {
4073
4073
  name: "@eventcatalog/generator-openapi",
4074
- version: "7.5.4",
4074
+ version: "7.6.0",
4075
4075
  description: "OpenAPI generator for EventCatalog",
4076
4076
  scripts: {
4077
4077
  build: "tsup",
@@ -4206,7 +4206,8 @@ var index_default = async (_, options) => {
4206
4206
  const document2 = await import_swagger_parser2.default.dereference(specFile);
4207
4207
  return {
4208
4208
  document: document2,
4209
- path: specFile
4209
+ path: specFile,
4210
+ version: serviceSpec.version || document2.info.version
4210
4211
  };
4211
4212
  } catch (error) {
4212
4213
  console.error(import_chalk4.default.red(`Failed to parse OpenAPI file: ${specFile}`));
@@ -4217,15 +4218,19 @@ var index_default = async (_, options) => {
4217
4218
  const validSpecs = await Promise.all(specs);
4218
4219
  const validSpecFiles = validSpecs.filter((v) => v !== null);
4219
4220
  const orderedSpecs = validSpecFiles.sort((a, b) => {
4220
- const versionA = a?.document.info.version ?? "";
4221
- const versionB = b?.document.info.version ?? "";
4221
+ const versionA = a?.version ?? "";
4222
+ const versionB = b?.version ?? "";
4222
4223
  return versionA.localeCompare(versionB);
4223
4224
  });
4224
4225
  for (const specification of orderedSpecs) {
4225
4226
  const document2 = specification.document;
4226
- const version = document2.info.version;
4227
+ const version = specification.version;
4227
4228
  const specPath = specification.path;
4228
- const service = buildService({ ...serviceSpec, path: specPath }, document2, serviceSpec.generateMarkdown);
4229
+ const service = buildService(
4230
+ { ...serviceSpec, path: specPath, version: specification.version },
4231
+ document2,
4232
+ serviceSpec.generateMarkdown
4233
+ );
4229
4234
  let serviceMarkdown = service.markdown;
4230
4235
  let serviceSpecificationsFiles = [];
4231
4236
  let serviceSpecifications = service.specifications;
@@ -4387,8 +4392,6 @@ var processMessagesForOpenAPISpec = async (pathToSpec, document2, servicePath, o
4387
4392
  if (preserveExistingMessages) {
4388
4393
  messageMarkdown = catalogedMessage.markdown;
4389
4394
  }
4390
- console.log("catalogedMessage version", catalogedMessage.version);
4391
- console.log("version", version);
4392
4395
  if (catalogedMessage.version !== version) {
4393
4396
  console.log("versioning message", message2.id);
4394
4397
  await versionMessage(message2.id);