Same name for inner classes leads to "share same reference" error #214
Unanswered
alexvoronov
asked this question in
Q&A
Replies: 1 comment
-
This is not an answer, more of a comment to my original question. Annotation |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I have multiple classes all having a nested class called "Param". When I try to generate schema, I get
ValueError: Types <class '__main__.B.Params'> and <class '__main__.A.Params'> share same reference 'Params'
:I understand that I can annotate each inner
Param
withapischema.type_name
, giving each of them a unique name, but that's manual work.Is it possible to use reference factory to create unique names automatically, e.g. based on type hierarchy? From what I see, reference factory takes only string "ref", that is the class name, and not the class itself that can be used to inspect the hierarchy. Is there any way around it?
Beta Was this translation helpful? Give feedback.
All reactions