@tim-smart/openapi-gen 0.4.11 → 0.4.12
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 +8 -1
- package/package.json +1 -1
package/main.js
CHANGED
|
@@ -35491,6 +35491,7 @@ var make65 = gen2(function* () {
|
|
|
35491
35491
|
payloadFormData: false,
|
|
35492
35492
|
successSchemas: /* @__PURE__ */ new Map(),
|
|
35493
35493
|
errorSchemas: /* @__PURE__ */ new Map(),
|
|
35494
|
+
voidSchemas: /* @__PURE__ */ new Set(),
|
|
35494
35495
|
paramsOptional: true
|
|
35495
35496
|
};
|
|
35496
35497
|
const schemaId = identifier2(operation.operationId ?? path2);
|
|
@@ -35562,7 +35563,7 @@ var make65 = gen2(function* () {
|
|
|
35562
35563
|
let defaultSchema;
|
|
35563
35564
|
Object.entries(operation.responses ?? {}).forEach(
|
|
35564
35565
|
([status2, response]) => {
|
|
35565
|
-
|
|
35566
|
+
while ("$ref" in response) {
|
|
35566
35567
|
response = resolveRef2(response.$ref);
|
|
35567
35568
|
}
|
|
35568
35569
|
if (response.content?.["application/json"]?.schema) {
|
|
@@ -35586,6 +35587,9 @@ var make65 = gen2(function* () {
|
|
|
35586
35587
|
op.errorSchemas.set(statusLower, schemaName);
|
|
35587
35588
|
}
|
|
35588
35589
|
}
|
|
35590
|
+
if (!response.content) {
|
|
35591
|
+
op.voidSchemas.add(status2.toLowerCase());
|
|
35592
|
+
}
|
|
35589
35593
|
}
|
|
35590
35594
|
);
|
|
35591
35595
|
if (op.successSchemas.size === 0 && defaultSchema) {
|
|
@@ -35730,6 +35734,9 @@ ${clientErrorSource(name2)}`;
|
|
|
35730
35734
|
operation.errorSchemas.forEach((schema, status2) => {
|
|
35731
35735
|
decodes.push(`"${status2}": decodeError("${schema}", ${schema})`);
|
|
35732
35736
|
});
|
|
35737
|
+
operation.voidSchemas.forEach((status2) => {
|
|
35738
|
+
decodes.push(`"${status2}": () => Effect.void`);
|
|
35739
|
+
});
|
|
35733
35740
|
decodes.push(`orElse: unexpectedStatus`);
|
|
35734
35741
|
pipeline.push(`withResponse(HttpClientResponse.matchStatus({
|
|
35735
35742
|
${decodes.join(",\n ")}
|