Skip to content

Commit b758daa

Browse files
authored
eng: fix forward type reference in Pydantic schemas BNCH-112697 (#223)
1 parent 444155a commit b758daa

File tree

1 file changed

+7
-0
lines changed
  • openapi_python_client/schema/openapi_schema_pydantic

1 file changed

+7
-0
lines changed

openapi_python_client/schema/openapi_schema_pydantic/header.py

+7
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,10 @@ class Header(Parameter):
2929
]
3030
},
3131
)
32+
33+
34+
# Calling model_rebuild() here helps Pydantic to resolve the forward references that were used
35+
# in defining Parameter and Encoding. Without this call, any subtle change to the loading order
36+
# of schema submodules could result in an error like "Parameter is not fully defined".
37+
# See: https://docs.pydantic.dev/latest/concepts/models/#rebuilding-model-schema
38+
Parameter.model_rebuild()

0 commit comments

Comments
 (0)