Repository navigation
feat: add the collection, primitive and no-content send methods - #155
Merged
Vincent Biret (baywet) merged 1 commit intoSep 17, 2026
Merged
Vincent Biret (baywet) merged 1 commit into
Vincent Biret (baywet) merged 1 commit into
Conversation
Andrea Peruffo (andreaTP)
commented
Sep 17, 2026
Contributor
- the request adapter only knew how to return a single object, so every other response shape either raised or silently returned the wrong thing
- enum and enum collection responses are read through the enum getters, matching how the other generators route them to the primitive send methods
- get_enum_value resolved nothing: it symbolized the raw wire value instead of looking it up in the enum, so "blue" came back as :blue rather than :Blue
- get_collection_of_enum_values did not exist, so an enum array fell through to the untyped passthrough and returned raw strings
- an empty body no longer needs a content type, so a 204 stops raising on every send method rather than only the void one
- the request adapter only knew how to return a single object, so every other response shape either raised or silently returned the wrong thing - enum and enum collection responses are read through the enum getters, matching how the other generators route them to the primitive send methods - get_enum_value resolved nothing: it symbolized the raw wire value instead of looking it up in the enum, so "blue" came back as :blue rather than :Blue - get_collection_of_enum_values did not exist, so an enum array fell through to the untyped passthrough and returned raw strings - an empty body no longer needs a content type, so a 204 stops raising on every send method rather than only the void one
Vincent Biret (baywet)
approved these changes
Sep 17, 2026
Vincent Biret (baywet)
left a comment
Member
There was a problem hiding this comment.
Thanks for the contribution!
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Empty binary responses return an empty stream, and new adapter calls do not fully match the parse-node abstraction signatures.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds request adapter support for object collections, primitive values, enums, and empty responses.
Changes:
- Adds send-method implementations and abstraction contracts.
- Adds enum resolution and collection parsing.
- Adds coverage for new response shapes and 204 responses.
File summaries
| File | Description |
|---|---|
components/http/lib/.../faraday_request_adapter.rb |
Dispatches response parsing by return type. |
components/serialization/json/lib/.../json_parse_node.rb |
Resolves scalar and collection enums. |
components/abstractions/lib/.../request_adapter.rb |
Defines new send-method contracts. |
components/abstractions/lib/.../parse_node.rb |
Adds enum collection parsing contract. |
components/http/spec/.../send_methods_spec.rb |
Tests send methods and empty responses. |
components/serialization/json/spec/json_enum_spec.rb |
Tests enum parsing. |
.rubocop_todo.yml |
Adjusts class-length allowance. |
Review details
- Files reviewed: 7/7 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.
|
|
||
| PRIMITIVE_READERS = { | ||
| 'String' => :get_string_value, | ||
| 'Float' => :get_float_value, |
| root_node = get_root_parse_node(response) | ||
| next root_node&.get_collection_of_enum_values(type) if type.is_a?(Hash) | ||
|
|
||
| root_node&.get_collection_of_primitive_values(type) |
Comment on lines
+87
to
+89
| execute_async(request_info, errors_mapping) do |response| | ||
| next StringIO.new(response.body.to_s) if type == StringIO | ||
| next get_root_parse_node(response)&.get_enum_value(type) if type.is_a?(Hash) |
Closed
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.