Skip to content

feat: serialize scalar request bodies and enum collections - #158

Merged
Vincent Biret (baywet) merged 1 commit into
microsoft:mainfrom
andreaTP:feat/scalar-body-and-enum-collections
Sep 18, 2026
Merged

Vincent Biret (baywet) merged 1 commit into
microsoft:mainfrom
andreaTP:feat/scalar-body-and-enum-collections

Conversation

@andreaTP

Copy link
Copy Markdown
Contributor
  • set_content_from_scalar did not exist, so a scalar request body went through set_content_from_parsable and failed to serialize
  • write_collection_of_enum_values did not exist
  • a primitive collection written as the document root kept only its last element, each one overwrote the root in turn

@baywet Vincent Biret (baywet) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The critical scalar root serialization issue and two moderate issues remain unresolved.

Get a fresh assessment by requesting another Copilot review.

Pull request overview

Adds scalar request-body serialization, enum collection support, and root primitive collection handling.

Changes:

  • Adds scalar type dispatch and enum collection APIs.
  • Updates JSON collection/root serialization.
  • Adds scalar and collection specs.
File summaries
File Summary
components/serialization/json/spec/json_enum_collection_writer_spec.rb Tests enum and primitive collection serialization.
components/serialization/json/lib/microsoft_kiota_serialization_json/json_serialization_writer.rb Moderate issue (3 votes): false and nil values are mishandled in root primitive collections.
components/abstractions/spec/request_information_scalar_spec.rb Moderate issue (2 votes): missing library require causes isolated execution to raise NameError.
components/abstractions/lib/microsoft_kiota_abstractions/serialization/serialization_writer.rb Adds the enum collection writer contract.
components/abstractions/lib/microsoft_kiota_abstractions/request_information.rb Critical issue (1 vote): date/time/UUID scalar roots can serialize as {} instead of scalar JSON values.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

- set_content_from_scalar did not exist, so a scalar request body went through set_content_from_parsable and failed to serialize
- write_collection_of_enum_values did not exist
- a primitive collection written as the document root kept only its last element, each one overwrote the root in turn
- the guid, date, time, date time and duration writers returned the converted scalar for a nil key without registering it as the root, so those bodies serialized to {}

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved blocking issues were identified.

Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0 new
  • Review effort level: Lite

@baywet
Vincent Biret (baywet) merged commit 57a4158 into microsoft:main Sep 18, 2026
71 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants