Skip to content

Commit b6c345a

Browse files
committed
fix setting root element and don't return empty values
1 parent 1f9ffe3 commit b6c345a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/microsoft_kiota_serialization_json/json_serialization_writer.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ def write_object_value(key, value)
162162
if !key
163163
temp = JsonSerializationWriter.new()
164164
value.serialize(temp)
165+
@writer = temp.writer
165166
return temp
166167
end
167168
begin
@@ -179,7 +180,7 @@ def write_enum_value(key, values)
179180
end
180181

181182
def get_serialized_content()
182-
return @writer.to_json #TODO encode to byte array to stay content type agnostic
183+
return @writer.compact.to_json #TODO encode to byte array to stay content type agnostic
183184
end
184185

185186
def write_additional_data(value)

0 commit comments

Comments
 (0)