Repository navigation
Fix constraints for inputs with defaults - #810
Open
ranjithguggilla wants to merge 2 commits into
Open
ranjithguggilla wants to merge 2 commits into
ranjithguggilla wants to merge 2 commits into
Conversation
…or constraints Skip schema constraints for missing or wrong-typed values so validation returns the errors already collected. Add regression tests for missing, invalid, and valid values. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This branch has not been 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.
Summary
Ensure validator constraints run for supplied values that match their schema's declared type, even when the schema also defines a default. Previously, a default-type shortcut skipped both type validation and constraints.
Values accepted only because their type matches a default of another type remain exempt from constraints, and invalid input types are reported without being passed to typed constraints. This PR includes the prerequisite invalid-input guard from
fix(serverless): report invalid input instead of raising from validator constraints.Adds regression tests for constrained optional inputs with defaults, valid values, default application, and
Nonedefaults.Validation
uv run --group test -- pytest -q --no-cov tests/test_serverless/test_utils/test_validate.py— 15 passed, 5 subtests passeduv run --group dev -- ruff check runpod/serverless/utils/rp_validator.py tests/test_serverless/test_utils/test_validate.py— passed