Skip to content

Use external types in OpenAPI#515

Merged
jakub-id merged 6 commits intomainfrom
request-type-open-api
Apr 11, 2026
Merged

Use external types in OpenAPI#515
jakub-id merged 6 commits intomainfrom
request-type-open-api

Conversation

@jakub-id
Copy link
Copy Markdown
Contributor

@jakub-id jakub-id commented Apr 10, 2026

This avoids the StructToMap for iso18626.Request, eventData, resultData, illTransactionData and Peer.customData

This avoids the  StructToMap. There are other cases when this should be used:
eventData, resultData, illTransactionData, Peer.customData
but in a seperate PR
Copilot AI review requested due to automatic review settings April 10, 2026 21:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the patron-requests OpenAPI-generated models/handlers to use a strongly-typed iso18626.Request for illRequest instead of an untyped map[string]any.

Changes:

  • Switch API handler and tests from map[string]interface{}-based illRequest handling to iso18626.Request.
  • Simplify ILL request validation by operating directly on the typed request (no marshal/unmarshal roundtrip).
  • Configure oapi-codegen to use an overlay intended to type illRequest in generated code.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

File Description
broker/patron_request/api/api-handler.go Returns and validates typed iso18626.Request for illRequest in API models/logic.
broker/patron_request/api/api-handler_test.go Updates unit tests to construct and pass typed ISO18626 requests.
broker/test/patron_request/api/api-handler_test.go Updates integration tests/assertions to use typed ISO18626 requests end-to-end.
broker/oapi/pr-cfg.yaml Adds oapi-codegen overlay configuration intended to type illRequest in generated code.

@jakub-id jakub-id changed the title Request type open api Use external types in OpenAPI Apr 10, 2026
@jakub-id jakub-id requested a review from Copilot April 10, 2026 21:25
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jakub-id jakub-id merged commit ea30780 into main Apr 11, 2026
5 checks passed
@jakub-id jakub-id deleted the request-type-open-api branch April 11, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants