.generator/src/generator/templates/api.j2 in datadog_api_client-2.19.0 vs .generator/src/generator/templates/api.j2 in datadog_api_client-2.20.0
- old
+ new
@@ -180,16 +180,16 @@
{%- set collection = parameter|collection_format %}
form_params['{{ name }}'] = {% if collection %}@api_client.build_collection_param(opts[:'{{ name|attribute_name }}'], :{{ collection }}){% else %}opts[:'{{ name|attribute_name }}']{% endif %} if !opts[:'{{ name|attribute_name }}'].nil?
{%- endfor %}
# http body (model)
- post_body = opts[:debug_body]{% if operation.requestBody %} || @api_client.object_to_http_body(
- {%- if operation.requestBody.required -%}
- {{ operation.get("x-codegen-request-body-name", "body") }}
+ post_body = opts[:debug_body]{% for name, parameter in operation|parameters if name == "body" %} || @api_client.object_to_http_body(
+ {%- if parameter.required -%}
+ body
{%- else -%}
- opts[:'{{ operation.get("x-codegen-request-body-name", "body") }}']
+ opts[:'body']
{%- endif -%}
- ){% endif %}
+ ){% endfor %}
# return_type
return_type = opts[:debug_return_type]{% if returnType %} || '{{ returnType }}'{% endif %}
# auth_names