fix: reject string schemas that mix pattern/format with length bounds (#49996)
Signed-off-by: Yufeng He <40085740+he-yufeng@users.noreply.github.com>
This commit is contained in:
@@ -14,6 +14,12 @@ pytestmark = pytest.mark.cpu_test
|
||||
def unsupported_string_schemas():
|
||||
return [
|
||||
{"type": "string", "format": "non_existing_format"},
|
||||
# pattern/format is compiled but length bounds are silently dropped,
|
||||
# so the combination must be rejected instead of producing quietly
|
||||
# wrong output
|
||||
{"type": "string", "pattern": "^a+$", "maxLength": 2},
|
||||
{"type": "string", "pattern": "^a+$", "minLength": 3},
|
||||
{"type": "string", "format": "email", "maxLength": 10},
|
||||
]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user