@prefecthq/fastmcp-ts 1.5.0 → 1.5.1

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/server.js CHANGED
@@ -3169,6 +3169,9 @@ function convertOpenAPISchemaToJsonSchema(schema, openapiVersion, options = {})
3169
3169
  for (const field of OPENAPI_SPECIFIC_FIELDS) {
3170
3170
  delete result[field];
3171
3171
  }
3172
+ if (options.stripFormats === true) {
3173
+ delete result.format;
3174
+ }
3172
3175
  if (options.removeReadOnly === true || options.removeWriteOnly === true) {
3173
3176
  result = filterPropertiesByAccess(result, options);
3174
3177
  }
@@ -3526,9 +3529,7 @@ function combineSchemasAndMapParams(route) {
3526
3529
  properties[propName] = propSchema;
3527
3530
  parameterMap[propName] = { location: "body", openapiName: propName };
3528
3531
  }
3529
- if (requestBody.required) {
3530
- required.push(...bodySchema.required ?? []);
3531
- }
3532
+ required.push(...bodySchema.required ?? []);
3532
3533
  } else {
3533
3534
  let paramName = String(
3534
3535
  typeof bodySchema.title === "string" ? bodySchema.title : "body"
@@ -3601,7 +3602,8 @@ function extractOutputSchemaFromResponses(responses, schemaDefinitions, openapiV
3601
3602
  }
3602
3603
  if (openapiVersion?.startsWith("3")) {
3603
3604
  outputSchema = convertOpenAPISchemaToJsonSchema(outputSchema, openapiVersion, {
3604
- removeWriteOnly: true
3605
+ removeWriteOnly: true,
3606
+ stripFormats: true
3605
3607
  });
3606
3608
  }
3607
3609
  if (outputSchema.type !== "object") {
@@ -3622,7 +3624,8 @@ function extractOutputSchemaFromResponses(responses, schemaDefinitions, openapiV
3622
3624
  if (openapiVersion?.startsWith("3")) {
3623
3625
  for (const name of Object.keys(processedDefs)) {
3624
3626
  processedDefs[name] = convertOpenAPISchemaToJsonSchema(processedDefs[name], openapiVersion, {
3625
- removeWriteOnly: true
3627
+ removeWriteOnly: true,
3628
+ stripFormats: true
3626
3629
  });
3627
3630
  }
3628
3631
  }
@@ -4127,7 +4130,7 @@ function unflattenArguments(route, flatArgs) {
4127
4130
  if (contentSchema && Object.keys(contentSchema).length > 0) {
4128
4131
  const contentType = Object.keys(contentSchema)[0];
4129
4132
  const bodySchema = contentSchema[contentType];
4130
- if (isPlainObject(bodySchema) && bodySchema.type === "object") {
4133
+ if (isPlainObject(bodySchema) && (bodySchema.type === "object" || truthy(bodySchema.properties))) {
4131
4134
  body = bodyProps;
4132
4135
  } else if (Object.keys(bodyProps).length === 1) {
4133
4136
  body = Object.values(bodyProps)[0];