Skip to content

Validate ILL request during PR POST#480

Merged
jakub-id merged 5 commits intomainfrom
validate-ill-req
Mar 25, 2026
Merged

Validate ILL request during PR POST#480
jakub-id merged 5 commits intomainfrom
validate-ill-req

Conversation

@jakub-id
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings March 24, 2026 21:53
Copy link
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

This PR adds server-side validation of incoming ISO18626 ILL request payloads when creating a Patron Request via the broker API, backed by schema-driven validation and corresponding test coverage.

Changes:

  • Validate illRequest during POST /patron-requests and return 400 for invalid requests.
  • Add unit/integration tests covering acceptance of valid minimal requests and rejection of invalid serviceType.
  • Update XSD→Go codegen tooling to github.com/indexdata/xsd2goxsl@v1.4.0 and enable validate=yes for ISO18626 generation.

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
sru/Makefile Pin xsd2goxsl generator to v1.4.0 (tooling update).
ncip/Makefile Pin xsd2goxsl generator to v1.4.0 (tooling update).
marcxml/Makefile Pin xsd2goxsl generator to v1.4.0 and clean up whitespace.
iso18626/Makefile Pin xsd2goxsl to v1.4.0 and enable validate=yes for schema-derived validation tags.
broker/tools.go Remove xsd2goxsl from build-time tool imports (tooling pinning moved to go run ...@version).
broker/test/patron_request/api/api-handler_test.go Add integration test asserting invalid ILL request is rejected on POST.
broker/patron_request/api/api-handler_test.go Update POST test to send a minimally valid illRequest payload.
broker/patron_request/api/api-handler.go Implement ILL request validation in POST handler and populate required header fields before validation.
broker/go.mod Add go-playground/validator dependency for request validation.
broker/go.sum Remove xsd2goxsl sums (but see review comment re: validator sums).
broker/Makefile Stop updating xsd2goxsl via deps-update-tools (tooling now pinned in submodule makefiles).

Copy link
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 10 out of 11 changed files in this pull request and generated 2 comments.

Copy link
Contributor

@adamdickmeiss adamdickmeiss left a comment

Choose a reason for hiding this comment

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

Nice

Copy link
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 10 out of 11 changed files in this pull request and generated 5 comments.

Copy link
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 10 out of 11 changed files in this pull request and generated 2 comments.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@jakub-id jakub-id merged commit 2f5b28c into main Mar 25, 2026
4 checks passed
@jakub-id jakub-id deleted the validate-ill-req branch March 25, 2026 10:27
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