Repository navigation
Refs #API-33: Document list inputs as arrays in request bodies - #24
Merged
Merged
Conversation
franco-mariani
requested review from
a team
and
a balanced review from Copilot
October 16, 2026 10:55
There was a problem hiding this comment.
🟢 Approval recommended
The focused change reuses existing parser behavior, adds regression coverage, and has no identified blocking issues.
0 open findings
What changed in this PR
Corrects request-body documentation so GraphQL list inputs appear as arrays rather than single objects.
Changes:
- Reuses the type parser’s schema reference generation.
- Adds regression coverage for list inputs while retaining non-list coverage.
| File | Description |
|---|---|
| spec/lib/graphql_to_rest/schema/basic/paths/graphql_to_path_request_body_spec.rb | Tests array attributes and updates the non-list reference expectation. |
| lib/graphql_to_rest/schema/basic/paths/graphql_to_path_request_body.rb | Delegates attributes schema generation to the type parser. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
matas-simonaitis
approved these changes
Oct 26, 2026
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.
Currently, the request body always documents `data.attributes` as a single object reference, even when the GraphQL input is a list (e.g. `createAbsenceBalanceCorrection(input: [AbsenceBalanceCorrectionCreateInput!]!)`). Swagger UI then shows an object where the endpoint expects an array.
This PR builds `attributes` with the type parser's existing `open_api_schema_reference`, so list inputs become `{ type: array, items: { $ref } }`. Non-list inputs produce the same schema as before.
In samesystem this changes two endpoints, both of which do take an array: `POST /{clientToken}/absence_balance_corrections` and `POST /{clientToken}/users/upsert_with_contracts`.