@eventcatalog/generator-openapi 7.5.5 → 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.mjs CHANGED
@@ -1570,7 +1570,7 @@ var buildService = (serviceOptions, document2, generateMarkdown) => {
1570
1570
  const generatedMarkdownForService = defaultMarkdown2(document2, schemaPath);
1571
1571
  return {
1572
1572
  id: serviceId,
1573
- version: document2.info.version,
1573
+ version: serviceOptions.version || document2.info.version,
1574
1574
  name: document2.info.title,
1575
1575
  summary: getSummary(document2),
1576
1576
  schemaPath,
@@ -4066,7 +4066,7 @@ import { join } from "path";
4066
4066
  // package.json
4067
4067
  var package_default = {
4068
4068
  name: "@eventcatalog/generator-openapi",
4069
- version: "7.5.5",
4069
+ version: "7.6.0",
4070
4070
  description: "OpenAPI generator for EventCatalog",
4071
4071
  scripts: {
4072
4072
  build: "tsup",
@@ -4201,7 +4201,8 @@ var index_default = async (_, options) => {
4201
4201
  const document2 = await SwaggerParser2.dereference(specFile);
4202
4202
  return {
4203
4203
  document: document2,
4204
- path: specFile
4204
+ path: specFile,
4205
+ version: serviceSpec.version || document2.info.version
4205
4206
  };
4206
4207
  } catch (error) {
4207
4208
  console.error(chalk4.red(`Failed to parse OpenAPI file: ${specFile}`));
@@ -4212,15 +4213,19 @@ var index_default = async (_, options) => {
4212
4213
  const validSpecs = await Promise.all(specs);
4213
4214
  const validSpecFiles = validSpecs.filter((v) => v !== null);
4214
4215
  const orderedSpecs = validSpecFiles.sort((a, b) => {
4215
- const versionA = a?.document.info.version ?? "";
4216
- const versionB = b?.document.info.version ?? "";
4216
+ const versionA = a?.version ?? "";
4217
+ const versionB = b?.version ?? "";
4217
4218
  return versionA.localeCompare(versionB);
4218
4219
  });
4219
4220
  for (const specification of orderedSpecs) {
4220
4221
  const document2 = specification.document;
4221
- const version = document2.info.version;
4222
+ const version = specification.version;
4222
4223
  const specPath = specification.path;
4223
- const service = buildService({ ...serviceSpec, path: specPath }, document2, serviceSpec.generateMarkdown);
4224
+ const service = buildService(
4225
+ { ...serviceSpec, path: specPath, version: specification.version },
4226
+ document2,
4227
+ serviceSpec.generateMarkdown
4228
+ );
4224
4229
  let serviceMarkdown = service.markdown;
4225
4230
  let serviceSpecificationsFiles = [];
4226
4231
  let serviceSpecifications = service.specifications;