You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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".
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; }
}
The text was updated successfully, but these errors were encountered:
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; }
}
The text was updated successfully, but these errors were encountered: