Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature request]: FlattenInheritanceHierarchy support in AspNetCore #2992

Open
sander1095 opened this issue Jul 23, 2024 · 0 comments
Open
Labels
feature suggestion help-wanted A change up for grabs for contributions from the community

Comments

@sander1095
Copy link

Is your feature request related to a specific problem? Or an existing feature?

My API models use inheritance but I do not want it to generate the base classes. It should just generate all the properties as part of the single class:

class A : B
{
    public string Prop { get; set; }
}

class B
{
    public string Prop2 {get;set;}
}

I know FlattenInheritanceHierarchy exists, but this is only for generating your client with NSwag.

I use openapi-typescript and this doesn't have such a feature. Therefore I'd like to be able to tell NSwag to not use inheritance in its model, something that Swashbuckle also doesn't.

Describe the solution you'd like

I'd like the result to be an OpenAPI schema component that defines an entity A with 2 properties: Prop and Prop2. Entity B should not be defined in the OpenAPI document

Additional context

No response

@martincostello martincostello added the help-wanted A change up for grabs for contributions from the community label Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature suggestion help-wanted A change up for grabs for contributions from the community
Projects
None yet
Development

No branches or pull requests

2 participants