feat: add composed types support (union/intersection) - #106
Conversation
Add infrastructure needed for the Kiota generator to emit composed type code for union and intersection types: - Add write_object_value to SerializationWriter interface with variadic additional_values_to_merge parameter - Add ComposedTypeWrapper marker module for generated wrapper classes - Add ParseNodeHelper.merge_deserializers_for_intersection_wrapper for merging field deserializers across intersection type members
Vincent Biret (baywet)
left a comment
There was a problem hiding this comment.
Thanks for the contribution!
|
(holding the merge for now until we get the corresponding generation PR) |
There was a problem hiding this comment.
Pull request overview
This PR adds core abstractions needed for Kiota’s Ruby generator to emit code for composed types (union/intersection), by extending serialization capabilities, introducing a marker module for generated wrapper types, and providing a helper for combining intersection deserializers.
Changes:
- Add
SerializationWriter#write_object_value(key, value, *additional_values_to_merge)to support composed-type serialization scenarios. - Introduce
MicrosoftKiotaAbstractions::ComposedTypeWrapperas a marker module for generated wrapper classes. - Add
ParseNodeHelper.merge_deserializers_for_intersection_wrapperand accompanying specs to merge field deserializers across intersection members.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| spec/parse_node_helper_spec.rb | Adds specs for the new marker module, writer API addition, and deserializer-merging helper behavior. |
| lib/microsoft_kiota_abstractions/serialization/serialization_writer.rb | Extends the serialization writer interface with write_object_value (variadic merge inputs). |
| lib/microsoft_kiota_abstractions/serialization/parse_node_helper.rb | Adds helper to merge get_field_deserializers hashes for intersection wrappers. |
| lib/microsoft_kiota_abstractions/serialization/composed_type_wrapper.rb | Adds empty marker module for composed-type wrapper classes. |
| lib/microsoft_kiota_abstractions.rb | Wires the new helper and marker module into the main require list. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
This one ? |
yes |
|
Vincent Biret (@baywet) are you waiting for something from me on this one? Ideally we should merge the 2 PRs to the gems and, when, the gems are available I'd be able to finalize the PR in Or do you have an alternative flow in mind? |
Add infrastructure needed for the Kiota generator to emit composed type code for union and intersection types: