Skip to content

v3.0: Issue with discriminator generating request DTO #4990

@souravk

Description

@souravk

Hello Team,

I am trying to implement polymorphism using OpenAPI by generating a class and child classes. Let's say I want to generate a class Class B that extends Class A. It has been generated using discriminantor function, which is good. But no, the issue is when I want to call it from Postman or another app by passing a JSON string, it returns 400 Bad Request. It's because I need to pass the type that mentioned the discriminator. But as this request dto used by another team, I don't want to change the payload structure. How can we achieve this? I want to keep the class generated as the same Class B extends A.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs attentionThe author has replied and people with triage rights should take action.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions