Repository navigation
fix(schema): handle field named 'required' in strict mode (#6209) - #6392
Open
user-Param wants to merge 2 commits into
Open
user-Param wants to merge 2 commits into
user-Param wants to merge 2 commits into
Conversation
…e#6209) The _make_strict_compatible loop skipped dict/list values under a key named 'required' (thinking it was the schema's required array). When a user field is literally named 'required' and contains a nested model, that nested model's properties were never processed for strict mode. Changed the loop to iterate over schema.values() instead of schema.items(), so every dict/list value is recursed into regardless of its key name. Also adds regression test test_optimizer_handles_field_named_required_in_strict_mode. Fixes browser-use#6209.
Preview approval requiredThis pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit |
|
def-Param seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
…e#6209) resolve merge conflict with v1 main: keep schema.py fix since file was deleted in v1
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.
Fixes #6209
Summary by cubic
Fixes strict-mode schema optimization for user fields literally named
required. Previously the recursive walk skipped any dict/list value under a key namedrequired(assuming it was the schema's required array), so a nested model under such a field never got its optional properties marked as required. The walk now iterates over values only, recursing into every dict/list regardless of key name, and adds a regression test for this case.Written for commit 388391e. Summary will update on new commits.