Repository navigation
PDFCLOUD-6243: Add PDF shape overlays - #45
Conversation
847f705 to
ed495f3
Compare
ed495f3 to
c13e6a3
Compare
|
Codex had some feedback:
|
|
In the future, please ask Codex to make a changes-requested review on the PR, assigning the findings to code lines. It can do that if you have |
datalogics-tsmith
left a comment
There was a problem hiding this comment.
Thanks—the core implementation and current live happy/error paths work, but I’m requesting changes because the published SDK contract is not fully established and documented. Please address the three inline comments: verify numeric bounds against the service with complete boundary parity, exhaustively validate the public structure-type Literal through both transports and live tests, and document the alias per repository policy.
✅ Deploy Preview for pdfrest-python ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
datalogics-cgreen
left a comment
There was a problem hiding this comment.
I'll allow it. 🧐
datalogics-gwalczak
left a comment
There was a problem hiding this comment.
Manager approval.
- Add sync and async shape helpers with typed line and rectangle inputs - Validate shape coordinates, colors, tagging, and PDF resources - Cover JSON serialization, live service behavior, and API guide discovery Assisted-by: Codex
- Resolve MkDocs cross-references for added shape object types - Restore strict documentation build validation Assisted-by: Codex
- Assert async timeout propagation and PDF MIME validation - Reject multiple input PDFs through both client transports - Cover shape geometry, opacity, and color range boundaries Assisted-by: Codex
- Accept one RGB or CMYK color field for each shape color - Route colors to pdfRest's RGB or CMYK wire fields by channel count - Update unit and live endpoint coverage Assisted-by: Codex
Assisted-by: Codex
- Describe line and rectangle shape fields for generated API reference - Mark the shape union as a type alias so its union renders correctly Assisted-by: Codex
- Prefer PDFREST_LIVE_BASE_URL before the standard endpoint candidates - Document live-test configuration and fallback behavior for contributors Assisted-by: Codex
- Demonstrate typed rectangle and line construction - Exercise tagging and report output metadata against a bundled PDF Assisted-by: Codex
Declare the public literal as a TypeAlias and describe the semantic role of each accepted spelling alongside the tagging requirement. Assisted-by: Codex
Share single-field boundary and structure-type cases between payload, client, and live tests. Check exact wire serialization and require local validation failures to stop before transport execution. Exercise invalid values through live body overrides and use the 20-page fixture to validate page selectors above the lower bound. Assisted-by: Codex
PDFCLOUD-6243
Why this change
The Python SDK did not expose the documented
/pdf-with-added-shapesoperation, forcing callers to build raw requests for line and rectangle overlays. This adds a typed, validated SDK workflow that matches the service contract.What changed (high level)
The clients now provide synchronous and asynchronous
add_shapes_to_pdfhelpers backed by Pydantic request models and public shape type contracts. The implementation keeps uploaded-file lifecycle handling consistent with existing helpers and serializes shape objects into the API JSON layout.Behavior changes
Callers can add one or more lines or rectangles to an uploaded PDF, including RGB or CMYK colors, opacity, stroke width, output naming, and optional accessibility tagging. Local validation rejects invalid coordinates, conflicting color modes, non-PDF inputs, empty shape lists, and tagging metadata without
tag_enabled=True.Validation
uv run pytest --ignore tests/live -n auto --maxschedchunk 2— 1,001 passed.PDFREST_LIVE_BASE_URL=http://sleipnir:3000/ uv run pytest tests/live/test_live_add_shapes_to_pdf.py -n auto --maxschedchunk 2— 4 passed.Risks and follow-ups
This is a stacked draft PR on #44: merge #44 first, then this PR. The PR base is
pdfcloud-6233-new-pdfrest-api-skill, so reviewers see only the endpoint-support layer. No breaking changes are intended.