···600600};
601601602602export type CallWithWeirdParameterNamesData = {
603603- body?: never;
603603+ /**
604604+ * This is the parameter that is sent as request body
605605+ */
606606+ body: string;
604607 headers: {
605608 /**
606609 * This is the parameter that goes into the request header
···600600};
601601602602export type CallWithWeirdParameterNamesData = {
603603- body?: never;
603603+ /**
604604+ * This is the parameter that is sent as request body
605605+ */
606606+ body: string;
604607 headers: {
605608 /**
606609 * This is the parameter that goes into the request header
···600600};
601601602602export type CallWithWeirdParameterNamesData = {
603603- body?: never;
603603+ /**
604604+ * This is the parameter that is sent as request body
605605+ */
606606+ body: string;
604607 headers: {
605608 /**
606609 * This is the parameter that goes into the request header
···600600};
601601602602export type CallWithWeirdParameterNamesData = {
603603- body?: never;
603603+ /**
604604+ * This is the parameter that is sent as request body
605605+ */
606606+ body: string;
604607 headers: {
605608 /**
606609 * This is the parameter that goes into the request header
···600600};
601601602602export type CallWithWeirdParameterNamesData = {
603603- body?: never;
603603+ /**
604604+ * This is the parameter that is sent as request body
605605+ */
606606+ body: string;
604607 headers: {
605608 /**
606609 * This is the parameter that goes into the request header
···600600};
601601602602export type CallWithWeirdParameterNamesData = {
603603- body?: never;
603603+ /**
604604+ * This is the parameter that is sent as request body
605605+ */
606606+ body: string;
604607 headers: {
605608 /**
606609 * This is the parameter that goes into the request header
···600600};
601601602602export type CallWithWeirdParameterNamesData = {
603603- body?: never;
603603+ /**
604604+ * This is the parameter that is sent as request body
605605+ */
606606+ body: string;
604607 headers: {
605608 /**
606609 * This is the parameter that goes into the request header
···600600};
601601602602export type CallWithWeirdParameterNamesData = {
603603- body?: never;
603603+ /**
604604+ * This is the parameter that is sent as request body
605605+ */
606606+ body: string;
604607 headers: {
605608 /**
606609 * This is the parameter that goes into the request header
···600600};
601601602602export type CallWithWeirdParameterNamesData = {
603603- body?: never;
603603+ /**
604604+ * This is the parameter that is sent as request body
605605+ */
606606+ body: string;
604607 headers: {
605608 /**
606609 * This is the parameter that goes into the request header
···600600};
601601602602export type CallWithWeirdParameterNamesData = {
603603- body?: never;
603603+ /**
604604+ * This is the parameter that is sent as request body
605605+ */
606606+ body: string;
604607 headers: {
605608 /**
606609 * This is the parameter that goes into the request header
···600600};
601601602602export type CallWithWeirdParameterNamesData = {
603603- body?: never;
603603+ /**
604604+ * This is the parameter that is sent as request body
605605+ */
606606+ body: string;
604607 headers: {
605608 /**
606609 * This is the parameter that goes into the request header
···600600};
601601602602export type CallWithWeirdParameterNamesData = {
603603- body?: never;
603603+ /**
604604+ * This is the parameter that is sent as request body
605605+ */
606606+ body: string;
604607 headers: {
605608 /**
606609 * This is the parameter that goes into the request header
···600600};
601601602602export type CallWithWeirdParameterNamesData = {
603603- body?: never;
603603+ /**
604604+ * This is the parameter that is sent as request body
605605+ */
606606+ body: string;
604607 headers: {
605608 /**
606609 * This is the parameter that goes into the request header
···600600};
601601602602export type CallWithWeirdParameterNamesData = {
603603- body?: never;
603603+ /**
604604+ * This is the parameter that is sent as request body
605605+ */
606606+ body: string;
604607 headers: {
605608 /**
606609 * This is the parameter that goes into the request header
···600600};
601601602602export type CallWithWeirdParameterNamesData = {
603603- body?: never;
603603+ /**
604604+ * This is the parameter that is sent as request body
605605+ */
606606+ body: string;
604607 headers: {
605608 /**
606609 * This is the parameter that goes into the request header
···600600};
601601602602export type CallWithWeirdParameterNamesData = {
603603- body?: never;
603603+ /**
604604+ * This is the parameter that is sent as request body
605605+ */
606606+ body: string;
604607 headers: {
605608 /**
606609 * This is the parameter that goes into the request header
···409409 * @param data.parameterHeader This is the parameter that goes into the header
410410 * @param data.parameterQuery This is the parameter that goes into the query params
411411 * @param data.parameterForm This is the parameter that goes into the form data
412412- * @param data.parameterBody This is the parameter that is sent as request body
413412 * @param data.parameterPath This is the parameter that goes into the path
414413 * @throws ApiError
415414 */
···428427 },
429428 formData: {
430429 parameterForm: data.parameterForm
431431- },
432432- body: data.parameterBody
430430+ }
433431 });
434432 }
435433···437435 * @param data The data for the request.
438436 * @param data.parameterHeader This is the parameter that goes into the request header
439437 * @param data.parameterQuery This is the parameter that goes into the request query params
440440- * @param data.parameterForm This is the parameter that goes into the request form data
441438 * @param data.parameterBody This is the parameter that is sent as request body
442439 * @param data.parameterPath1 This is the parameter that goes into the path
443440 * @param data.parameterPath2 This is the parameter that goes into the path
···460457 query: {
461458 default: data._default,
462459 'parameter-query': data.parameterQuery
463463- },
464464- formData: {
465465- parameter_form: data.parameterForm
466460 },
467461 body: data.parameterBody
468462 });
···679679680680export type CallWithParametersData = {
681681 /**
682682- * This is the parameter that is sent as request body
683683- */
684684- parameterBody: string;
685685- /**
686682 * This is the parameter that goes into the form data
687683 */
688684 parameterForm: string;
···709705 * This is the parameter that is sent as request body
710706 */
711707 parameterBody: string;
712712- /**
713713- * This is the parameter that goes into the request form data
714714- */
715715- parameterForm: string;
716708 /**
717709 * This is the parameter that goes into the request header
718710 */
···115115 };
116116 const requestBodyObjectRequired: Array<string> = [];
117117118118+ // Check if there are any body parameters (not formData) to determine default media type
119119+ const hasBodyParameter = operation.requestBody?.some((param) => {
120120+ const resolvedParam =
121121+ '$ref' in param ? context.resolveRef<ParameterObject>(param.$ref) : param;
122122+ return resolvedParam.in === 'body';
123123+ });
124124+118125 for (const requestBodyParameter of operation.requestBody ?? []) {
119126 const requestBody =
120127 '$ref' in requestBodyParameter
···129136 required: undefined,
130137 type: requestBody.type === 'file' ? 'string' : requestBody.type,
131138 };
139139+140140+ // Only default to JSON if we have body parameters and no consumes specified
141141+ // FormData parameters without consumes should not get a default media type
142142+ let mimeTypes = operation.consumes;
143143+ if (!mimeTypes && hasBodyParameter && requestBody.in === 'body') {
144144+ mimeTypes = ['application/json'];
145145+ }
146146+132147 const contents = mediaTypeObjects({
133133- mimeTypes: operation.consumes,
148148+ mimeTypes,
134149 response: { schema },
135150 });
136151 // TODO: add support for multiple content types, for now prefer JSON
+2-11
specs/2.0.x/full.yaml
···113113 in: formData
114114 type: string
115115 required: true
116116- - description: This is the parameter that is sent as request body
117117- name: parameterBody
118118- in: body
119119- type: string
120120- required: true
121116 - description: This is the parameter that goes into the path
122117 name: parameterPath
123118 in: path
···164159 in: query
165160 type: string
166161 required: true
167167- - description: This is the parameter that goes into the request form data
168168- name: parameter_form
169169- in: formData
170170- type: string
171171- required: true
172162 - description: This is the parameter that is sent as request body
173163 name: PARAMETER-BODY
174164 in: body
175175- type: string
176165 required: true
166166+ schema:
167167+ type: string
177168 - description: api-version should be required in standalone clients
178169 name: api-version
179170 in: path
+4-16
specs/v2.json
···130130 "required": true
131131 },
132132 {
133133- "description": "This is the parameter that is sent as request body",
134134- "name": "parameterBody",
135135- "in": "body",
136136- "type": "string",
137137- "required": true
138138- },
139139- {
140133 "description": "This is the parameter that goes into the path",
141134 "name": "parameterPath",
142135 "in": "path",
···201194 "required": true
202195 },
203196 {
204204- "description": "This is the parameter that goes into the request form data",
205205- "name": "parameter_form",
206206- "in": "formData",
207207- "type": "string",
208208- "required": true
209209- },
210210- {
211197 "description": "This is the parameter that is sent as request body",
212198 "name": "PARAMETER-BODY",
213199 "in": "body",
214214- "type": "string",
215215- "required": true
200200+ "required": true,
201201+ "schema": {
202202+ "type": "string"
203203+ }
216204 },
217205 {
218206 "description": "api-version should be required in standalone clients",