@kubb/ast 5.0.0-alpha.53 → 5.0.0-alpha.55

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.cjs CHANGED
@@ -454,7 +454,7 @@ function createOperationParams(node, options) {
454
454
  const pathParams = casedParams.filter((p) => p.in === "path");
455
455
  const queryParams = casedParams.filter((p) => p.in === "query");
456
456
  const headerParams = casedParams.filter((p) => p.in === "header");
457
- const bodyType = node.requestBody?.schema ? wrapType(resolver?.resolveDataName(node) ?? "unknown") : void 0;
457
+ const bodyType = node.requestBody?.content?.[0]?.schema ? wrapType(resolver?.resolveDataName(node) ?? "unknown") : void 0;
458
458
  const bodyRequired = node.requestBody?.required ?? false;
459
459
  const queryGroupType = resolver ? resolveGroupType({
460
460
  node,
@@ -1536,7 +1536,7 @@ function getChildren(node, recurse) {
1536
1536
  case "Output": return [];
1537
1537
  case "Operation": return [
1538
1538
  ...node.parameters,
1539
- ...node.requestBody?.schema ? [node.requestBody.schema] : [],
1539
+ ...node.requestBody?.content?.flatMap((c) => c.schema ? [c.schema] : []) ?? [],
1540
1540
  ...node.responses
1541
1541
  ];
1542
1542
  case "Schema": {
@@ -1649,10 +1649,13 @@ function transform(node, options) {
1649
1649
  })),
1650
1650
  requestBody: op.requestBody ? {
1651
1651
  ...op.requestBody,
1652
- schema: op.requestBody.schema ? transform(op.requestBody.schema, {
1653
- ...options,
1654
- parent: op
1655
- }) : void 0
1652
+ content: op.requestBody.content?.map((c) => ({
1653
+ ...c,
1654
+ schema: c.schema ? transform(c.schema, {
1655
+ ...options,
1656
+ parent: op
1657
+ }) : void 0
1658
+ }))
1656
1659
  } : void 0,
1657
1660
  responses: op.responses.map((r) => transform(r, {
1658
1661
  ...options,