Repository navigation
PDFCLOUD-6596 Prefer composed Pydantic validation in API skill - #56
Merged
datalogics-tsmith merged 1 commit intoOct 20, 2026
Merged
Conversation
- Compare API contracts with existing validators before adding checks. - Compose constrained types and keep custom validators focused. - Use the existing page-range composition as a model for compound inputs. Assisted-by: Codex
✅ Deploy Preview for pdfrest-python ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
datalogics-tsmith
approved these changes
Oct 20, 2026
datalogics-tsmith
deleted the
pdfcloud-6596-prefer-composed-pydantic-validation
branch
October 20, 2026 18:43
This branch was successfully deployed
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.
PDFCLOUD-6596
Why this change
The API skill can lead endpoint work toward new parser and validation functions without first checking whether existing payload types already express the contract. Duplicating these rules increases maintenance work and makes validation easier to diverge across endpoints.
What changed (high level)
The skill now directs agents to compare the discovered API contract with existing constrained aliases, validator factories, payload models, and serializers before adding validation. It favors composing Pydantic types and native constraints, using
AscendingPageRangeand_AscendingPageRangeTupleas the concrete example, and keeps custom validators limited to input adaptation or rules that native constraints cannot express.Behavior changes
Future API work using the skill should reuse existing validation or explain the specific contract mismatch requiring an extension. Endpoint-specific syntax and serialization still need to be preserved. This change updates development instructions only; it introduces no SDK runtime or public API changes.
Validation
The skill passed
quick_validate.py.uv run pre-commit run --files .agents/skills/pdfrest-client-api/SKILL.mdpassed after Markdown formatting, and the commit hooks passed, including basedpyright.git diff --check origin/main..HEADpassed. The branch contains one commit changing only the skill file. The pre-push basedpyright hook also passed when run explicitly without stashing; its redundant invocation during push was skipped after automatic stashing of unrelated IDE changes caused a files-modified failure despite zero diagnostics.Runtime and live tests, the Python interpreter and example matrices, and the documentation build were not rerun locally because this change only edits skill instructions.
Risks and follow-ups
The guidance biases implementation choices but does not enforce them mechanically. Reviews still need to verify that reuse preserves the discovered endpoint contract; no migration is required.