@eventcatalog/generator-openapi 4.0.6 → 4.0.7
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 +20 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -619,7 +619,7 @@ var import_chalk = __toESM(require("chalk"));
|
|
|
619
619
|
// package.json
|
|
620
620
|
var package_default = {
|
|
621
621
|
name: "@eventcatalog/generator-openapi",
|
|
622
|
-
version: "4.0.
|
|
622
|
+
version: "4.0.7",
|
|
623
623
|
description: "OpenAPI generator for EventCatalog",
|
|
624
624
|
scripts: {
|
|
625
625
|
build: "tsup",
|
|
@@ -1745,11 +1745,29 @@ var processMessagesForOpenAPISpec = async (pathToSpec, document, servicePath, op
|
|
|
1745
1745
|
}
|
|
1746
1746
|
if (requestBodiesAndResponses?.responses) {
|
|
1747
1747
|
for (const [statusCode, schema] of Object.entries(requestBodiesAndResponses.responses)) {
|
|
1748
|
+
const getContent = () => {
|
|
1749
|
+
try {
|
|
1750
|
+
return JSON.stringify(schema, null, 2);
|
|
1751
|
+
} catch (error) {
|
|
1752
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
1753
|
+
return JSON.stringify(
|
|
1754
|
+
schema,
|
|
1755
|
+
(key, value) => {
|
|
1756
|
+
if (typeof value === "object" && value !== null) {
|
|
1757
|
+
if (seen.has(value)) return "[Circular]";
|
|
1758
|
+
seen.add(value);
|
|
1759
|
+
}
|
|
1760
|
+
return value;
|
|
1761
|
+
},
|
|
1762
|
+
2
|
|
1763
|
+
);
|
|
1764
|
+
}
|
|
1765
|
+
};
|
|
1748
1766
|
await addFileToMessage(
|
|
1749
1767
|
message.id,
|
|
1750
1768
|
{
|
|
1751
1769
|
fileName: `response-${statusCode}.json`,
|
|
1752
|
-
content:
|
|
1770
|
+
content: getContent()
|
|
1753
1771
|
},
|
|
1754
1772
|
message.version
|
|
1755
1773
|
);
|