fix(api): return 204 No Content on failed PDF filters; add OpenAPI responses and safe resource handling #4406
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.
Description of Changes
What was changed
@ApiResponses
for filter endpoints with200
(PDF passed) and204
(did not pass) including@Content
and media types.null
returns withResponseEntity.noContent().build()
when a filter condition is not met.PDDocument
is properly closed using try-with-resources in relevant endpoints.compare<T extends Comparable<T>>()
helper for page count, page size, file size, and rotation checks.Why the change was made
null
responses) and improve API reliability for clients consuming these endpoints.PDDocument
.Checklist
General
Documentation
UI Changes (if applicable)
Testing (if applicable)