cancel
Showing results for 
Search instead for 
Did you mean: 

Polymorphic responses in Python Client Side

Highlighted
New Contributor

Polymorphic responses in Python Client Side

Code generation for the response of a method that has multiple possible accepted response schemas is broken in generated python code. I have a GET method that is supposed utilize 3.0's polymorphic capabilities by having a response that should return "oneOf" 3 types of schemas. My response looks like this:

 

components:
  responses:
    RunResponse:
      description: different response types for Runs
      content:
        application/json:
          schema:
            oneOf:
            - $ref: '#/components/schemas/AllRun'
            - $ref: '#/components/schemas/IonRun'
            - $ref: '#/components/schemas/IllRun'

But in the response type in the generated code it is looking for this: 

Capture.PNG

When ran with this as the response type I get an error as there is no model of "OneOfAllRunsIonRunsIllruns". How can this be fixed? Because as of right now polymorphism doesn't work with python generated code.

New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors
Top Kudoed Posts