openapi-python-client 0.26.0__py3-none-any.whl → 0.26.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -40,6 +40,7 @@ from .schemas import (
40
40
  Parameters,
41
41
  ReferencePath,
42
42
  Schemas,
43
+ get_reference_simple_name,
43
44
  parse_reference_path,
44
45
  update_parameters_with_data,
45
46
  update_schemas_with_data,
@@ -324,17 +325,30 @@ def _create_schemas(
324
325
  while still_making_progress:
325
326
  still_making_progress = False
326
327
  errors = []
327
- next_round = []
328
+ next_round: list[tuple[str, oai.Reference | oai.Schema]] = []
328
329
  # Only accumulate errors from the last round, since we might fix some along the way
329
330
  for name, data in to_process:
330
- if isinstance(data, oai.Reference):
331
- schemas.errors.append(PropertyError(data=data, detail="Reference schemas are not supported."))
332
- continue
331
+ schema_data: oai.Reference | oai.Schema | None = data
333
332
  ref_path = parse_reference_path(f"#/components/schemas/{name}")
334
333
  if isinstance(ref_path, ParseError):
335
334
  schemas.errors.append(PropertyError(detail=ref_path.detail, data=data))
336
335
  continue
337
- schemas_or_err = update_schemas_with_data(ref_path=ref_path, data=data, schemas=schemas, config=config)
336
+ if isinstance(data, oai.Reference):
337
+ # Fully dereference reference schemas
338
+ seen = [name]
339
+ while isinstance(schema_data, oai.Reference):
340
+ data_ref_schema = get_reference_simple_name(schema_data.ref)
341
+ if data_ref_schema in seen:
342
+ schemas.errors.append(PropertyError(detail="Circular schema references found", data=data))
343
+ break
344
+ # use derefenced schema definition for this schema
345
+ schema_data = components.get(data_ref_schema)
346
+ if isinstance(schema_data, oai.Schema):
347
+ schemas_or_err = update_schemas_with_data(
348
+ ref_path=ref_path, data=schema_data, schemas=schemas, config=config
349
+ )
350
+ else:
351
+ schemas.errors.append(PropertyError(detail="Referent schema not found", data=data))
338
352
  if isinstance(schemas_or_err, PropertyError):
339
353
  next_round.append((name, data))
340
354
  errors.append(schemas_or_err)
@@ -3,7 +3,7 @@ name = "{{ project_name }}"
3
3
  version = "{{ package_version }}"
4
4
  description = "{{ package_description }}"
5
5
  authors = []
6
- requires-python = "~=3.9"
6
+ requires-python = ">=3.9,<4.0"
7
7
  readme = "README.md"
8
8
  dependencies = [
9
9
  "httpx>=0.23.0,<0.29.0",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: openapi-python-client
3
- Version: 0.26.0
3
+ Version: 0.26.2
4
4
  Summary: Generate modern Python clients from OpenAPI
5
5
  Project-URL: repository, https://github.com/openapi-generators/openapi-python-client
6
6
  Author-email: Dylan Anthony <contact@dylananthony.com>
@@ -26,9 +26,9 @@ Requires-Dist: jinja2<4.0.0,>=3.0.0
26
26
  Requires-Dist: pydantic<3.0.0,>=2.10
27
27
  Requires-Dist: python-dateutil<3.0.0,>=2.8.1
28
28
  Requires-Dist: ruamel-yaml<0.19.0,>=0.18.6
29
- Requires-Dist: ruff<0.13,>=0.2
29
+ Requires-Dist: ruff<0.14,>=0.2
30
30
  Requires-Dist: shellingham<2.0.0,>=1.3.2
31
- Requires-Dist: typer<0.17,>0.6
31
+ Requires-Dist: typer<0.20,>0.6
32
32
  Requires-Dist: typing-extensions<5.0.0,>=4.8.0
33
33
  Description-Content-Type: text/markdown
34
34
 
@@ -9,7 +9,7 @@ openapi_python_client/parser/bodies.py,sha256=HALIpRqSkwZCxknYGXSCmxbaH0-l19MZOr
9
9
  openapi_python_client/parser/errors.py,sha256=HzX7fLhGJEgTY12N9ICjS3KDBnfn-AlCTBRqXmVeoqI,1225
10
10
  openapi_python_client/parser/openapi.py,sha256=04OAKFw_kqw6dOURb1SU12njOmjG1he5C_Uq88FUDDc,23086
11
11
  openapi_python_client/parser/responses.py,sha256=fKZ3OEGiflwjPC7DQ7l2FdGJIaJDaZJ2JT1R7TDPjzQ,8605
12
- openapi_python_client/parser/properties/__init__.py,sha256=DL6miAjN2XhEvi7DkAaZrTD4p7ej_waD8AaIySjhRBM,16376
12
+ openapi_python_client/parser/properties/__init__.py,sha256=Y6AlvUoNbnTBOkQjVSq1PeUmd5p_by9ZownzmCexB18,17159
13
13
  openapi_python_client/parser/properties/any.py,sha256=pj8KdhwS1M0cxNC_Y1MKdCPtp0YT3WVMAyZX-4bnyVc,1339
14
14
  openapi_python_client/parser/properties/boolean.py,sha256=xdkZyiUvdhKmEmGmaT88biPGoocsgbjxbqzv_2mlkv8,2042
15
15
  openapi_python_client/parser/properties/const.py,sha256=dEw07zPA6xcizt6N0ElXm4_taZ4AEAt8OJ3BXTdCkyQ,3771
@@ -86,7 +86,7 @@ openapi_python_client/templates/pyproject.toml.jinja,sha256=rBaFq0oqlGeW-NesqPeF
86
86
  openapi_python_client/templates/pyproject_pdm.toml.jinja,sha256=0W1cc19w62v4WB_kVpVvuMxOGTQT8dblWGwvJWM25SM,383
87
87
  openapi_python_client/templates/pyproject_poetry.toml.jinja,sha256=1B0DAZeKd4At88wJKTgqRqa4TA6rGai0JHUTHhZhS8M,481
88
88
  openapi_python_client/templates/pyproject_ruff.toml.jinja,sha256=OgFfCd9Ca3YsU8WdCxqJoJdCJEtzADpxAxfMghqzn80,74
89
- openapi_python_client/templates/pyproject_uv.toml.jinja,sha256=HIfoTu3a6pg0uY-6ZE0E1GBpUuyc5F9GRkV2lYyphbs,465
89
+ openapi_python_client/templates/pyproject_uv.toml.jinja,sha256=B4yvrjj5gz_-_DyZi1aJwz2UHrRQzraiR9A08VkZ8b0,470
90
90
  openapi_python_client/templates/setup.py.jinja,sha256=aHZJXkKS0-sFhK0OH3THvRoUMVAkIo_Lt3OtUPJj1nI,611
91
91
  openapi_python_client/templates/str_enum.py.jinja,sha256=5SxGRu_sZxEILC425D45YSu8s12vJGM2PWwYWjOUl8M,232
92
92
  openapi_python_client/templates/types.py.jinja,sha256=hEuJx--jICd2FIQy390JC7wcmZgGuB-uFzp3_mouNdo,1398
@@ -106,8 +106,8 @@ openapi_python_client/templates/property_templates/model_property.py.jinja,sha25
106
106
  openapi_python_client/templates/property_templates/property_macros.py.jinja,sha256=s0DqGOc8rbEKptUtH1tAht08wahN3xXpaGfyzVa3Kog,580
107
107
  openapi_python_client/templates/property_templates/union_property.py.jinja,sha256=Xi-5XAbyRH65eYz6G1RNdchjKiYl99J4JyhvLqdR9h0,4088
108
108
  openapi_python_client/templates/property_templates/uuid_property.py.jinja,sha256=g1YZFkrC7PXX_r8Cbf5z_yJRzQoViow4yFWvBqUxj2o,1004
109
- openapi_python_client-0.26.0.dist-info/METADATA,sha256=Nwbx-WjJLRxrm3602XU3CWq8Gak5TgOgX9lJSXvo-NQ,11732
110
- openapi_python_client-0.26.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
111
- openapi_python_client-0.26.0.dist-info/entry_points.txt,sha256=iRfSdN2foASZXr8GghkYa6KRXkDgO0EFfLut5IXoBTU,72
112
- openapi_python_client-0.26.0.dist-info/licenses/LICENSE,sha256=4dpxQYqY0DB3aTauRrqYRuu6BVNsPSJdYeUT3sH6pQY,1075
113
- openapi_python_client-0.26.0.dist-info/RECORD,,
109
+ openapi_python_client-0.26.2.dist-info/METADATA,sha256=K67XTYSRvit4SinbqPvu71TOHYpwoUKIWIVxvQcj0Hg,11732
110
+ openapi_python_client-0.26.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
111
+ openapi_python_client-0.26.2.dist-info/entry_points.txt,sha256=iRfSdN2foASZXr8GghkYa6KRXkDgO0EFfLut5IXoBTU,72
112
+ openapi_python_client-0.26.2.dist-info/licenses/LICENSE,sha256=4dpxQYqY0DB3aTauRrqYRuu6BVNsPSJdYeUT3sH6pQY,1075
113
+ openapi_python_client-0.26.2.dist-info/RECORD,,