Skip to content

fix: enum and composed type reading, expose error status and headers - #171

Merged
Vincent Biret (baywet) merged 5 commits into
microsoft:mainfrom
andreaTP:fix/open-payments-runtime
Oct 1, 2026
Merged

Vincent Biret (baywet) merged 5 commits into
microsoft:mainfrom
andreaTP:fix/open-payments-runtime

Conversation

@andreaTP

Copy link
Copy Markdown
Contributor

Runtime side of microsoft/kiota#7956 (Open Payments with Kiota Ruby). One commit per change:

Verified with every component's specs, RuboCop, and Kiota's 19-description Ruby IT matrix against both current Kiota main and the pending generator fixes.

- date, time, date-time, duration and guid readers return nil unless the node is a string
- collection readers return nil unless the node is an array
- get_child_node returns nil unless the node is an object

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

The runtime fixes are consistent with existing contracts and include focused regression coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Fixes Ruby runtime handling for composed types, wire-valued enums, and HTTP error metadata.

Changes:

  • Makes JSON readers shape-safe and resolves enums by wire value.
  • Deserializes shared intersection fields into every member.
  • Exposes response status and headers through ApiError.
File Description
components/​serialization/​json/​spec/​json_reader_shape_spec.rb Tests shape-safe readers.
components/​serialization/​json/​spec/​json_enum_spec.rb Tests wire-valued enum parsing.
components/​serialization/​json/​spec/​json_enum_collection_writer_spec.rb Tests wire-value serialization.
components/​serialization/​json/​lib/​microsoft_kiota_serialization_json/​json_parse_node.rb Adds shape guards and enum value lookup.
components/​http/​spec/​microsoft_kiota_faraday/​faraday_request_adapter_spec.rb Tests error response metadata.
components/​http/​lib/​microsoft_kiota_faraday/​faraday_request_adapter.rb Attaches response metadata to API errors.
components/​abstractions/​spec/​parse_node_helper_spec.rb Tests shared intersection fields.
components/​abstractions/​lib/​microsoft_kiota_abstractions/​serialization/​parse_node_helper.rb Composes duplicate field handlers.
components/​abstractions/​lib/​microsoft_kiota_abstractions/​api_error.rb Adds response metadata accessors.

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

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

🟡 Changes recommended

The code is ready, but the quoted PR title would produce a nonconforming squash commit.

Review effort: Balanced
Findings: None

@andreaTP Andrea Peruffo (andreaTP) changed the title fix: runtime fixes for Open Payments and composed types feat: fix enum and composed type reading, expose error status and headers Oct 1, 2026
@baywet Vincent Biret (baywet) changed the title feat: fix enum and composed type reading, expose error status and headers fix: enum and composed type reading, expose error status and headers Oct 1, 2026

@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) merged commit 34d92ab into microsoft:main Oct 1, 2026
72 checks passed
@andreaTP

Copy link
Copy Markdown
Contributor Author

Thanks Vincent Biret (@baywet) ! Can we have a release with those changes?

@baywet

Copy link
Copy Markdown
Member

its already on the way #164

@andreaTP

Copy link
Copy Markdown
Contributor Author

Amazing! Thanks!

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.

generation - Ruby - Add ResponseStatusCode to API error/exception generation - Expose Response Headers in API exception/error [Ruby]

3 participants