@tim-smart/openapi-gen 0.4.9 → 0.4.11
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/main.js +11 -0
- package/package.json +1 -1
package/main.js
CHANGED
|
@@ -35559,8 +35559,12 @@ var make65 = gen2(function* () {
|
|
|
35559
35559
|
);
|
|
35560
35560
|
op.payloadFormData = true;
|
|
35561
35561
|
}
|
|
35562
|
+
let defaultSchema;
|
|
35562
35563
|
Object.entries(operation.responses ?? {}).forEach(
|
|
35563
35564
|
([status2, response]) => {
|
|
35565
|
+
if ("$ref" in response) {
|
|
35566
|
+
response = resolveRef2(response.$ref);
|
|
35567
|
+
}
|
|
35564
35568
|
if (response.content?.["application/json"]?.schema) {
|
|
35565
35569
|
const schemaName = gen3.addSchema(
|
|
35566
35570
|
`${schemaId}${status2}`,
|
|
@@ -35568,6 +35572,10 @@ var make65 = gen2(function* () {
|
|
|
35568
35572
|
context7,
|
|
35569
35573
|
true
|
|
35570
35574
|
);
|
|
35575
|
+
if (status2 === "default") {
|
|
35576
|
+
defaultSchema = schemaName;
|
|
35577
|
+
return;
|
|
35578
|
+
}
|
|
35571
35579
|
const statusLower = status2.toLowerCase();
|
|
35572
35580
|
const statusMajorNumber = Number(status2[0]);
|
|
35573
35581
|
if (isNaN(statusMajorNumber)) {
|
|
@@ -35580,6 +35588,9 @@ var make65 = gen2(function* () {
|
|
|
35580
35588
|
}
|
|
35581
35589
|
}
|
|
35582
35590
|
);
|
|
35591
|
+
if (op.successSchemas.size === 0 && defaultSchema) {
|
|
35592
|
+
op.successSchemas.set("2xx", defaultSchema);
|
|
35593
|
+
}
|
|
35583
35594
|
operations.push(op);
|
|
35584
35595
|
});
|
|
35585
35596
|
Object.entries(spec2.paths).forEach(
|