Skip to content

fix(ruby): dispatch every response shape to the right request adapter - #8256

Merged
Vincent Biret (baywet) merged 2 commits into
microsoft:mainfrom
andreaTP:fix/ruby-send-method-dispatch
Sep 29, 2026
Merged

Vincent Biret (baywet) merged 2 commits into
microsoft:mainfrom
andreaTP:fix/ruby-send-method-dispatch

Conversation

@andreaTP

@andreaTP Andrea Peruffo (andreaTP) commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Generated Ruby clients only ever called send_async, which reads a single object, so most
response shapes were broken: void raised factory cannot be null, binary raised on an
undefined Binary constant, scalars emitted a bare lowercase type name, and a collection of
models silently returned one empty model.

Dispatches to all five request adapter methods, mirroring the Python generator. Also fixes
enum collections, scalar and binary request bodies, the int64/double/decimal/int8/
uint8/base64 formats, and a date being read with get_time_value.

Requires the runtime gems at 0.22.0, already released, so the pins move with it.

it/ruby/spec/basic/integration_test_basic.rb has been commented out since it was written.
It now makes a real call and asserts the typed error.

Binary upload still fails in FaradayRequestAdapter, which calls .empty? on the StringIO
body. Generator side is correct, that is the remaining half of kiota-ruby#54.

fixes microsoft/kiota-ruby#42,
fixes microsoft/kiota-ruby#67
fixes microsoft/kiota-ruby#125.
Covers items 2, 3 and 6 of #7956.

Copilot AI lite review requested due to automatic review settings September 22, 2026 12:57
@andreaTP
Andrea Peruffo (andreaTP) requested a review from a team as a code owner September 22, 2026 12:57

This comment was marked as outdated.

This comment was marked as outdated.

Copilot AI review requested due to automatic review settings September 22, 2026 14:59

This comment was marked as outdated.

Copilot AI review requested due to automatic review settings September 22, 2026 16:17

This comment was marked as outdated.

This comment was marked as outdated.

Copilot AI review requested due to automatic review settings September 22, 2026 17:33

This comment was marked as outdated.

Copilot AI review requested due to automatic review settings September 22, 2026 18:02

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

Copilot AI review requested due to automatic review settings September 29, 2026 14:29
@github-actions

This comment was marked as outdated.

This comment was marked as outdated.

… method

- void, collection, scalar, enum and binary responses all went through send_async, which only reads a single object
- binary is now StringIO; only a whole body is a stream, a collection of binary values is a payload
- enum collections were generated as object collections, calling create_from_discriminator_value on a plain Hash
- scalar request bodies went through set_content_from_parsable and failed to serialize
- int64, double, decimal, int8, uint8 and the base64 formats deserialized through constants nothing defines
- a date was read with get_time_value because the primitive type map collapsed Date onto Time
- the request body was only set when a request configuration parameter was present
- a resolved model keeps its factory even when named like a primitive, binary or void
- appsettings.json moves to the 0.22.0 runtime gems

This comment was marked as outdated.

Copilot AI review requested due to automatic review settings September 29, 2026 14:43

This comment was marked as outdated.

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.

Copilot review overview

🔵 Needs a closer look

Add dedicated writer coverage for the scalar stream-response dispatch path.

Review effort: Lite
Findings: None

Resolved since last review (4)

@baywet

Copy link
Copy Markdown
Member

Andrea Peruffo (@andreaTP) I think we're getting really close here, maybe missing additional tests?

Add dedicated writer coverage for the scalar stream-response dispatch path.

Copilot AI review requested due to automatic review settings September 29, 2026 16:13

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.

Copilot review overview

🟢 Approval recommended

All reviewed changes have been addressed and no blocking issues remain.

Review effort: Lite
Findings: None

@andreaTP

Copy link
Copy Markdown
Contributor Author

Vincent Biret (@baywet) seems like we are finally here 🎉

@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.

Thank you for making the changes!

@baywet
Vincent Biret (baywet) added this pull request to the merge queue Sep 29, 2026
Merged via the queue into microsoft:main with commit b0fec4f Sep 29, 2026
330 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

3 participants