pydantic-core
pydantic-core copied to clipboard
False-positive `SchemaError` for keyword-only args: Non-default argument follows default argument
- pydantic-2.6.4
- pydantic-core-2.16.3
Defining
@pydantic.validate_call()
def foo(*, x: int = 1, y: str):
print(x, y)
raises:
SchemaError: Error building "call" validator:
SchemaError: Error building "arguments" validator:
SchemaError: Non-default argument 'y' follows default argument
however, this should be tolerated as both x
and y
are keyword-only arguments.