def test_json_schema_input_type_with_recursive_refs(validator) -> None:
    """Test that recursive `'definition-ref` schemas for `json_schema_input_type` are not inlined."""

    class Model(BaseModel):
        model: Annotated[
            'Model',
            PlainSerializer(lambda v: v, return_type='Model'),
            validator,
        ]

    json_schema = Model.model_json_schema()

    assert 'Model' in json_schema['$defs']
    assert json_schema['$ref'] == '#/$defs/Model'
Test that recursive `'definition-ref` schemas for `json_schema_input_type` are not inlined.
tests/test_json_schema.py