diff --git a/.apigentools-info b/.apigentools-info index a1f5ea6222a9..bb1e5d2a5c5c 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2024-01-18 23:59:59.323435", - "spec_repo_commit": "7dba000a" + "regenerated": "2024-01-19 15:18:10.917989", + "spec_repo_commit": "b407748b" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2024-01-18 23:59:59.344143", - "spec_repo_commit": "7dba000a" + "regenerated": "2024-01-19 15:18:10.933129", + "spec_repo_commit": "b407748b" } } } \ No newline at end of file diff --git a/.generator/src/generator/templates/api.j2 b/.generator/src/generator/templates/api.j2 index 384e9122702f..3225b2f6cc73 100644 --- a/.generator/src/generator/templates/api.j2 +++ b/.generator/src/generator/templates/api.j2 @@ -182,13 +182,13 @@ module {{ module_name }}::{{ version|upper }} {%- 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 %} diff --git a/features/step_definitions/request.rb b/features/step_definitions/request.rb index c9740be29ac8..5e2931f70fb6 100644 --- a/features/step_definitions/request.rb +++ b/features/step_definitions/request.rb @@ -216,6 +216,9 @@ def build_given(api_version, operation) def model_builder(param, obj) model = ScenariosModelMappings["v#{@api_version}.#{@operation_id}"][param] + if model == 'File' + return File.open(File.join(__dir__, "..", "v" + @api_version, obj)) + end @api_client.convert_to_type(obj, model, "V#{@api_version}") end end diff --git a/features/v2/organizations.feature b/features/v2/organizations.feature index d7fe87808f64..187f192cd02e 100644 --- a/features/v2/organizations.feature +++ b/features/v2/organizations.feature @@ -20,7 +20,7 @@ Feature: Organizations When the request is sent Then the response status is 400 Bad Request - @skip-go @skip-java @skip-python @skip-ruby @skip-terraform-config @skip-typescript @skip-validation @team:DataDog/team-aaa-identity + @integration-only @skip-terraform-config @skip-validation @team:DataDog/team-aaa-identity Scenario: Upload IdP metadata returns "OK" response Given request contains "idp_file" parameter with value "fixtures/organizations/saml_configurations/valid_idp_metadata.xml" When the request is sent diff --git a/lib/datadog_api_client/v1/api/organizations_api.rb b/lib/datadog_api_client/v1/api/organizations_api.rb index b722fe854ca9..92f6b0f62754 100644 --- a/lib/datadog_api_client/v1/api/organizations_api.rb +++ b/lib/datadog_api_client/v1/api/organizations_api.rb @@ -413,7 +413,7 @@ def upload_idp_for_org_with_http_info(public_id, idp_file, opts = {}) form_params['idp_file'] = idp_file # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'IdpResponse' diff --git a/lib/datadog_api_client/v2/api/organizations_api.rb b/lib/datadog_api_client/v2/api/organizations_api.rb index c39fd69e027c..353b18a2af5b 100644 --- a/lib/datadog_api_client/v2/api/organizations_api.rb +++ b/lib/datadog_api_client/v2/api/organizations_api.rb @@ -63,7 +63,7 @@ def upload_idp_metadata_with_http_info(opts = {}) form_params['idp_file'] = opts[:'idp_file'] if !opts[:'idp_file'].nil? # http body (model) - post_body = opts[:debug_body] || @api_client.object_to_http_body(body) + post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type]