@orpc/openapi 0.0.4 → 0.0.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.
package/dist/index.js CHANGED
@@ -3949,20 +3949,16 @@ function zodToJsonSchema(schema, options) {
3949
3949
  return json;
3950
3950
  }
3951
3951
  case ZodFirstPartyTypeKind.ZodNaN: {
3952
- const schema_ = schema;
3953
3952
  return { const: "NaN" };
3954
3953
  }
3955
3954
  case ZodFirstPartyTypeKind.ZodBigInt: {
3956
- const schema_ = schema;
3957
3955
  const json = { type: "string", pattern: "^-?[0-9]+$" };
3958
3956
  return json;
3959
3957
  }
3960
3958
  case ZodFirstPartyTypeKind.ZodBoolean: {
3961
- const schema_ = schema;
3962
3959
  return { type: "boolean" };
3963
3960
  }
3964
3961
  case ZodFirstPartyTypeKind.ZodDate: {
3965
- const schema_ = schema;
3966
3962
  const jsonSchema = { type: "string", format: Format.Date };
3967
3963
  return jsonSchema;
3968
3964
  }
@@ -4233,7 +4229,7 @@ function generateOpenAPI(opts, options) {
4233
4229
  let inputSchema = internal.InputSchema ? zodToJsonSchema(internal.InputSchema, { mode: "input" }) : {};
4234
4230
  const outputSchema = internal.OutputSchema ? zodToJsonSchema(internal.OutputSchema, { mode: "output" }) : {};
4235
4231
  const params = (() => {
4236
- const names = path.match(/{([^}]+)}/g);
4232
+ const names = path.match(/\{([^}]+)\}/g);
4237
4233
  if (!names || !names.length) {
4238
4234
  return void 0;
4239
4235
  }
@@ -4277,7 +4273,8 @@ function generateOpenAPI(opts, options) {
4277
4273
  ) : void 0,
4278
4274
  required: inputSchema.required?.filter((v) => v !== name),
4279
4275
  examples: inputSchema.examples?.map((example) => {
4280
- if (!isPlainObject(example)) return example;
4276
+ if (!isPlainObject(example))
4277
+ return example;
4281
4278
  return Object.entries(example).reduce(
4282
4279
  (acc, [key, value]) => {
4283
4280
  if (key !== name) {
@@ -4405,7 +4402,7 @@ function generateOpenAPI(opts, options) {
4405
4402
  parameters: parameters.length ? parameters : void 0,
4406
4403
  requestBody,
4407
4404
  responses: {
4408
- "200": successResponse
4405
+ 200: successResponse
4409
4406
  }
4410
4407
  };
4411
4408
  builder.addPath(path, {
@@ -4415,7 +4412,8 @@ function generateOpenAPI(opts, options) {
4415
4412
  return preSerialize(builder.getSpec());
4416
4413
  }
4417
4414
  function isFileSchema(schema) {
4418
- if (typeof schema !== "object" || schema === null) return false;
4415
+ if (typeof schema !== "object" || schema === null)
4416
+ return false;
4419
4417
  return "type" in schema && "contentMediaType" in schema && typeof schema.type === "string" && typeof schema.contentMediaType === "string";
4420
4418
  }
4421
4419
  export {