Hi, it seems that the SKip And Take parameters are reported as being of type Form in the metadata page … and they do not show up in the Swagger UI.
I succesfully workaround the problem writing this
typeof(QueryBase).GetProperty(“Skip”).AddAttributes(new ApiMemberAttribute {IsRequired = false, ParameterType = “Query”, DataType = “integer” });
I don’t think an opt-in behaviour is a good idea for ApiMember attribute …
Say I have a dto with 25 properties … If I need to add a description to one of them (using ApiMember) … I’ll have to add that attribute to all of them…
Adding ApiMember (for example to specify that an input field is required) hides all the AutoQuery parameters, as you described. Because those properties are not in my custom DTO, I can’t even add an ApiMember attribute to them to bring them back. How can use ApiMember but not lose the skip/take etc. params?
In current design adding [ApiMember] hides all other non-annotated by [ApiMember] properties. Like [DataMember] in serialization. And the only way to make them visible or use plugin filters or by dynamically add [ApiMember] attribute to remaining properties. Alternative way could be an adding option to Swagger/OpenApi plugin configuration, which changes the behavior of hiding non-annotated members, but this change in design need to be approved by @mythz first
I understand the behavior - however in this case, because there are properties on a AutoQuery object that we don’t control, we cannot add ApiMember to them to opt them in. You understand the problem?
As I said in previous post [ApiMember] attributes can be added dynamically to any types during program execution. One note that these attributes have to be added before AppHost.Init(), so you can add them in constructor
I think that the current behaviour is not a good idea … properties without apimember should fall back to an “autonomous” fallback behaviour.
BTW : when I moved to openapi … I had all autoquerybase object properties set to parameter type “form” even if there was no apimember on the input dto
so I add to write this