@tim-smart/openapi-gen 0.4.10 → 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.
Files changed (2) hide show
  1. package/main.js +10 -0
  2. 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,6 +35563,9 @@ var make65 = gen2(function* () {
35562
35563
  let defaultSchema;
35563
35564
  Object.entries(operation.responses ?? {}).forEach(
35564
35565
  ([status2, response]) => {
35566
+ while ("$ref" in response) {
35567
+ response = resolveRef2(response.$ref);
35568
+ }
35565
35569
  if (response.content?.["application/json"]?.schema) {
35566
35570
  const schemaName = gen3.addSchema(
35567
35571
  `${schemaId}${status2}`,
@@ -35583,6 +35587,9 @@ var make65 = gen2(function* () {
35583
35587
  op.errorSchemas.set(statusLower, schemaName);
35584
35588
  }
35585
35589
  }
35590
+ if (!response.content) {
35591
+ op.voidSchemas.add(status2.toLowerCase());
35592
+ }
35586
35593
  }
35587
35594
  );
35588
35595
  if (op.successSchemas.size === 0 && defaultSchema) {
@@ -35727,6 +35734,9 @@ ${clientErrorSource(name2)}`;
35727
35734
  operation.errorSchemas.forEach((schema, status2) => {
35728
35735
  decodes.push(`"${status2}": decodeError("${schema}", ${schema})`);
35729
35736
  });
35737
+ operation.voidSchemas.forEach((status2) => {
35738
+ decodes.push(`"${status2}": () => Effect.void`);
35739
+ });
35730
35740
  decodes.push(`orElse: unexpectedStatus`);
35731
35741
  pipeline.push(`withResponse(HttpClientResponse.matchStatus({
35732
35742
  ${decodes.join(",\n ")}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tim-smart/openapi-gen",
3
- "version": "0.4.10",
3
+ "version": "0.4.12",
4
4
  "description": "Generate Effect http clients from OpenAPI specs",
5
5
  "bin": "main.js",
6
6
  "repository": {