Skip to content

Refs #API-33: Document list inputs as arrays in request bodies - #24

Merged
franco-mariani merged 4 commits into
mainfrom
feature/API-33-list-request-body
Nov 13, 2026
Merged

franco-mariani merged 4 commits into
mainfrom
feature/API-33-list-request-body

Conversation

@franco-mariani

@franco-mariani franco-mariani commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

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

@franco-mariani
franco-mariani requested review from a team and a balanced review from Copilot October 16, 2026 10:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@franco-mariani
franco-mariani merged commit 7059fd4 into main Nov 13, 2026
7 checks passed
@franco-mariani
franco-mariani deleted the feature/API-33-list-request-body branch November 13, 2026 14:40
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.

3 participants