Skip to content

Commit

Permalink
[python] update circular import
Browse files Browse the repository at this point in the history
Signed-off-by: ふぁ <[email protected]>
  • Loading branch information
fa0311 committed Sep 23, 2023
1 parent f36b540 commit fc3e024
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@ from pprint import pprint
{{#vendorExtensions.x-py-postponed-example-imports}}
{{{.}}}
{{/vendorExtensions.x-py-postponed-example-imports}}
{{classname}}.{{#usePydanticV2}}model_rebuild{{/usePydanticV2}}{{^usePydanticV2}}update_forward_refs{{/usePydanticV2}}()
try:
{{classname}}.{{#usePydanticV2}}model_rebuild{{/usePydanticV2}}{{^usePydanticV2}}update_forward_refs{{/usePydanticV2}}()
except Exception:
pass
{{/vendorExtensions.x-py-postponed-example-imports.size}}
Original file line number Diff line number Diff line change
Expand Up @@ -185,5 +185,8 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}
{{#vendorExtensions.x-py-postponed-model-imports}}
{{{.}}}
{{/vendorExtensions.x-py-postponed-model-imports}}
{{classname}}.{{#usePydanticV2}}model_rebuild{{/usePydanticV2}}{{^usePydanticV2}}update_forward_refs{{/usePydanticV2}}()
try:
{{classname}}.{{#usePydanticV2}}model_rebuild{{/usePydanticV2}}{{^usePydanticV2}}update_forward_refs{{/usePydanticV2}}()
except Exception:
pass
{{/vendorExtensions.x-py-postponed-model-imports.size}}
Original file line number Diff line number Diff line change
Expand Up @@ -369,5 +369,8 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}
{{#vendorExtensions.x-py-postponed-model-imports}}
{{{.}}}
{{/vendorExtensions.x-py-postponed-model-imports}}
{{classname}}.{{#usePydanticV2}}model_rebuild{{/usePydanticV2}}{{^usePydanticV2}}update_forward_refs{{/usePydanticV2}}()
try:
{{classname}}.{{#usePydanticV2}}model_rebuild{{/usePydanticV2}}{{^usePydanticV2}}update_forward_refs{{/usePydanticV2}}()
except Exception:
pass
{{/vendorExtensions.x-py-postponed-model-imports.size}}
Original file line number Diff line number Diff line change
Expand Up @@ -217,5 +217,8 @@ class {{classname}}({{#parent}}{{{.}}}{{/parent}}{{^parent}}BaseModel{{/parent}}
{{#vendorExtensions.x-py-postponed-model-imports}}
{{{.}}}
{{/vendorExtensions.x-py-postponed-model-imports}}
{{classname}}.{{#usePydanticV2}}model_rebuild{{/usePydanticV2}}{{^usePydanticV2}}update_forward_refs{{/usePydanticV2}}()
try:
{{classname}}.{{#usePydanticV2}}model_rebuild{{/usePydanticV2}}{{^usePydanticV2}}update_forward_refs{{/usePydanticV2}}()
except Exception:
pass
{{/vendorExtensions.x-py-postponed-model-imports.size}}
Original file line number Diff line number Diff line change
Expand Up @@ -2197,27 +2197,27 @@ components:
properties:
optionalDict:
$ref: "#/components/schemas/DictWithAdditionalProperties"
#Circular-Reference-Model:
# type: object
# properties:
# size:
# type: integer
# nested:
# $ref: '#/components/schemas/FirstRef'
#FirstRef:
# type: object
# properties:
# category:
# type: string
# self_ref:
# $ref: '#/components/schemas/SecondRef'
#SecondRef:
# type: object
# properties:
# category:
# type: string
# circular_ref:
# $ref: '#/components/schemas/Circular-Reference-Model'
Circular-Reference-Model:
type: object
properties:
size:
type: integer
nested:
$ref: '#/components/schemas/FirstRef'
FirstRef:
type: object
properties:
category:
type: string
self_ref:
$ref: '#/components/schemas/SecondRef'
SecondRef:
type: object
properties:
category:
type: string
circular_ref:
$ref: '#/components/schemas/Circular-Reference-Model'
InnerDictWithAdditionalProperties:
type: object
additionalProperties:
Expand Down

0 comments on commit fc3e024

Please sign in to comment.