From a5a4c7e4ba54dde7bd69638c9e0531f31f321a7e Mon Sep 17 00:00:00 2001 From: Vincent Biret Date: Tue, 28 Mar 2023 15:29:48 -0400 Subject: [PATCH] - fixes a bug where requests with bodies would fail in Ruby Signed-off-by: Vincent Biret --- CHANGELOG.md | 1 + src/Kiota.Builder/Writers/Ruby/CodeMethodWriter.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9890db1a29..a4743bf6a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Fixed a bug where lookup of reference ids failed for AllOf more than one level up. - Fixed a bug where a CLI client would not set the content types for requests. (Shell) - Fixed linting errors by re-ordering methods and properties in Python. +- Fixed a bug where requests with bodies would fail in Ruby. [#2473](https://github.com/microsoft/kiota/issues/2473) - Changed python import mechanism to facilitate code completion. [#2380](https://github.com/microsoft/kiota/issues/2380) - Fixed a bug where discriminator methods were missing possible types in Python [#2381](https://github.com/microsoft/kiota/issues/2381) - Fixed a bug where boolean or number enums would be mapped to enums instead of primitive types. [#2367](https://github.com/microsoft/kiota/issues/2367) diff --git a/src/Kiota.Builder/Writers/Ruby/CodeMethodWriter.cs b/src/Kiota.Builder/Writers/Ruby/CodeMethodWriter.cs index e1dbb9c0da..7e9409ed36 100644 --- a/src/Kiota.Builder/Writers/Ruby/CodeMethodWriter.cs +++ b/src/Kiota.Builder/Writers/Ruby/CodeMethodWriter.cs @@ -296,7 +296,7 @@ private void WriteRequestGeneratorBody(CodeMethod codeElement, RequestParams req if (requestParams.requestBody.Type.Name.Equals(conventions.StreamTypeName, StringComparison.OrdinalIgnoreCase)) writer.WriteLine($"request_info.set_stream_content({requestParams.requestBody.Name})"); else if (parentClass.GetPropertyOfKind(CodePropertyKind.RequestAdapter) is CodeProperty requestAdapterProperty) - writer.WriteLine($"request_info.set_content_from_parsable(self.{requestAdapterProperty.Name.ToSnakeCase()}, \"{codeElement.RequestBodyContentType}\", {requestParams.requestBody.Name})"); + writer.WriteLine($"request_info.set_content_from_parsable(@{requestAdapterProperty.Name.ToSnakeCase()}, \"{codeElement.RequestBodyContentType}\", {requestParams.requestBody.Name})"); } } writer.WriteLine("return request_info");