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

Class properties inherit from an abstract class recognized with type "object" #944

Open
gabry opened this issue Apr 9, 2019 · 0 comments

Comments

@gabry
Copy link

gabry commented Apr 9, 2019

Hi,
in my controllers each filter of GET methods is defined as a complex class.
Each property of the complex class (e.g. ProductFilter) inherits from an abstract class.
Here https://github.com/gabry/GZWebApplication.git replicated code in order to allow help me troubleshooting.
I expected to fill on Swagger UI each property of Product filter, actually they're seen as an "object".

Read here https://github.com/RicoSuter/NJsonSchema/wiki/Inheritance, added attributes over classes, but the properties FilterId, Name, Category, Price result as an "object".
Read some other issues, but none of them allow me to solve the issue:
RicoSuter/NSwag#1652
#829

Can you please help me?

Thanks.
Regards

public IHttpActionResult GetProductByComplexFilter([FromUri] ProductFilter filter)

public class ProductFilter {
public GZIntFilter FilterId { get; set; }
public GZStringFilter Name { get; set; }
public GZStringFilter Category { get; set; }
public GZIntFilter Price { get; set; }
}

public class GZStringFilter : GZFilter {
//...
}

public class GZIntFilter : GZFilter<int?> {
//...
}

public abstract class GZFilter : IGZFilter {
//...
}

public interface IGZFilter {
bool IsValid { get; }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant