"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.bodyMiddleware=bodyMiddleware;const formData_1=require("../../Openapi/formData");async function bodyMiddleware(e,n){if(e.req.requestOptions?.content)if(e.req.requestOptions.content instanceof formData_1.FormDataBody){const t=e.req.requestOptions.content;e.req.requestOptions.content=t.toReadable(),e.req.signedBody=t.signedBody(),e.req.requestOptions.headers={...e.req.requestOptions.headers,...t.headers()},e.req.requestOptions.contentType=void 0}else e.req.requestOptions.content=JSON.stringify(e.req.requestOptions.content);await n()}