Conversation
Contributor
There was a problem hiding this comment.
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
illRequestduringPOST /patron-requestsand return400for 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.0and enablevalidate=yesfor 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). |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.
No description provided.