Repository: pydantic/pydantic-extra-types (language: python)

Issue:
Regression in test_json_schema with Pydantic 2.9
```
$ gh repo clone pydantic/pydantic-extra-types
$ cd pydantic-extra-types
$ python3.12 -m venv _e
$ . _e/bin/activate
(_e) $ pip install -e .[all]
(_e) $ pip install -r requirements/testing.in
(_e) $ python -m pytest
[…]
=================================================================================================== FAILURES ===================================================================================================
_______________________________________________________________________________________________ test_json_schema _______________________________________________________________________________________________

    def test_json_schema():
        class Model(BaseModel):
            value: Coordinate

        assert Model.model_json_schema(mode='validation')['$defs']['Coordinate'] == {
            'properties': {
                'latitude': {'maximum': 90.0, 'minimum': -90.0, 'title': 'Latitude', 'type': 'number'},
                'longitude': {'maximum': 180.0, 'minimum': -180.0, 'title': 'Longitude', 'type': 'number'},
            },  
            'required': ['latitude', 'longitude'],
            'title': 'Coordinate',
            'type': 'object',
        }   
        assert Model.model_json_schema(mode='validation')['properties']['value'] == {
            'anyOf': [
                {'$ref': '#/$defs/Coordinate'},
                {
                    'maxItems': 2,
                    'minItems': 2,
                    'prefixItems': [{'type': 'number'}, {'type': 'number'}],
                    'type': 'array',
                },
                {'type': 'string'},
            ],
            'title': 'Value',
        }
>       assert Model.model_json_schema(mode='serialization') == {   
            '$defs': {
                'Coordinate': {
                    'properties': {
                        'latitude': {'maximum': 90.0, 'minimum': -90.0, 'title': 'Latitude', 'type': 'number'},
                        'longitude': {'maximum': 180.0, 'minimum': -180.0, 'title': 'Longitude', 'type': 'number'},
                    },
                    'required': ['latitude', 'longitude'],
                    'title': 'Coordinate',
                    'type': 'object',
                }
            },
            'properties': {'value': {'allOf': [{'$ref': '#/$defs/Coordinate'}], 'title': 'Value'}},
            'required': ['value'],
            'title': 'Model',
            'type': 'object',
        }
E       AssertionError: assert {'$defs': {'C... 'Model', ...} == {'$defs': {'C... 'Model', ...}
E         
E         Omitting 4 identical items, use -vv to show
E         Differing items:
E         {'properties': {'value': {'$ref': '#/$defs/Coordinate', 'title': 'Value'}}} != {'properties': {'value': {
E         
E         ...Full output truncated (2 lines hidden), use '-vv' to show

tests/test_coordinate.py:180: AssertionError
                                          Summary of Failures                                          
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━┓
┃  File                      ┃  Function          ┃  Function Line  ┃  Error Line  ┃  Error           ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━┩
│  tests/test_coordinate.py  │  test_json_schema  │  154            │  180         │  AssertionError  │
└────────────────────────────┴────────────────────┴─────────────────┴──────────────┴──────────────────┘
Results (5.50s):
         1 failed
     13056 passed
(_e) $ pip install pydantic==2.8.2
(_e) $ python -m pytest
[…]
Results (5.60s):
     13057 passed
```


Discussion / hints:
Looking at

```
E         Differing items:
E         {'properties': {'value': {'$ref': '#/$defs/Coordinate', 'title': 'Value'}}} != {'properties': {'value': {'allOf': [{'$ref': '#/$defs/Coordinate'}], 'title': 'Value'}}}
```

it seems the schemas are not identical, but are equivalent.

Fix patch:
diff --git a/requirements/pyproject.txt b/requirements/pyproject.txt
index aab552b6..a44249f2 100644
--- a/requirements/pyproject.txt
+++ b/requirements/pyproject.txt
@@ -1,5 +1,5 @@
 #
-# This file is autogenerated by pip-compile with Python 3.11
+# This file is autogenerated by pip-compile with Python 3.12
 # by the following command:
 #
 #    pip-compile --extra=all --no-emit-index-url --output-file=requirements/pyproject.txt pyproject.toml
@@ -12,9 +12,9 @@ phonenumbers==8.13.31
     # via pydantic-extra-types (pyproject.toml)
 pycountry==23.12.11
     # via pydantic-extra-types (pyproject.toml)
-pydantic==2.6.3
+pydantic==2.9.1
     # via pydantic-extra-types (pyproject.toml)
-pydantic-core==2.16.3
+pydantic-core==2.23.3
     # via pydantic
 python-dateutil==2.8.2
     # via
@@ -32,5 +32,8 @@ typing-extensions==4.10.0
     # via
     #   pydantic
     #   pydantic-core
+    #   pydantic-extra-types (pyproject.toml)
 tzdata==2024.1
-    # via pendulum
+    # via
+    #   pendulum
+    #   pydantic-extra-types (pyproject.toml)


Test patch:
diff --git a/tests/test_coordinate.py b/tests/test_coordinate.py
index 199d988e..e75ab865 100644
--- a/tests/test_coordinate.py
+++ b/tests/test_coordinate.py
@@ -189,7 +189,7 @@ class Model(BaseModel):
                 'type': 'object',
             }
         },
-        'properties': {'value': {'allOf': [{'$ref': '#/$defs/Coordinate'}], 'title': 'Value'}},
+        'properties': {'value': {'$ref': '#/$defs/Coordinate', 'title': 'Value'}},
         'required': ['value'],
         'title': 'Model',
         'type': 'object',