next-openapi-gen 0.10.4 → 0.10.5
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.
|
@@ -148,9 +148,9 @@ export class PagesRouterStrategy {
|
|
|
148
148
|
if (respSetMatch) {
|
|
149
149
|
responseSet = respSetMatch[1].trim();
|
|
150
150
|
}
|
|
151
|
-
const
|
|
152
|
-
if (
|
|
153
|
-
addResponses =
|
|
151
|
+
const addMatches = [...cleanedComment.matchAll(/@add\s+([^\n\r@]*)/g)];
|
|
152
|
+
if (addMatches.length > 0) {
|
|
153
|
+
addResponses = addMatches.map((m) => m[1].trim()).join(",");
|
|
154
154
|
}
|
|
155
155
|
const opIdMatch = cleanedComment.match(/@operationId\s+(\S+)/);
|
|
156
156
|
if (opIdMatch) {
|
|
@@ -102,6 +102,8 @@ export class RouteProcessor {
|
|
|
102
102
|
customResponses.forEach((responseRef) => {
|
|
103
103
|
const [code, ref] = responseRef.split(":");
|
|
104
104
|
if (ref) {
|
|
105
|
+
// Ensure the referenced schema is resolved (triggers Zod converter)
|
|
106
|
+
this.schemaProcessor.getSchemaContent({ responseType: ref });
|
|
105
107
|
// Custom schema: "409:ConflictResponse"
|
|
106
108
|
// 204 No Content should not have a content section per HTTP/OpenAPI spec
|
|
107
109
|
if (code === "204") {
|
package/dist/lib/utils.js
CHANGED
|
@@ -123,10 +123,9 @@ export function extractJSDocComments(path) {
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
if (commentValue.includes("@add")) {
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
addResponses = match[1].trim();
|
|
126
|
+
const matches = [...commentValue.matchAll(/@add\s+([^\n\r@]*)/g)];
|
|
127
|
+
if (matches.length > 0) {
|
|
128
|
+
addResponses = matches.map((m) => m[1].trim()).join(",");
|
|
130
129
|
}
|
|
131
130
|
}
|
|
132
131
|
if (commentValue.includes("@operationId")) {
|
package/package.json
CHANGED