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
Is your feature request related to a problem? Please describe the problem.
We are trying to use v6 with generic methods to reduce duplicate boiler plate code, but struggle to do this efficiently. We struggled with the following:
GetRequestConfiguration
This class seems to be part of each Builder class and there is not one abstract parent implementation for all Builder classes. We can't write a generic method handling each entity because there are hundreds of seperate GetRequestConfiguration implementations, e.g. one for UsersRequestBuilder and this method now can only be used for UsersRequestBuilder:
The same applies for PostRequestConfiguration and all other classes.
BaseCollectionPaginationCountResponse
Here we see some problems:
This class is not typed at all. In v5 there is a generic return type of the response class which determines the correct class for the actual item values in the page collection.
After the typing you could add getValue to the base class and not implement it in each subclass which should help to determine the actual return type in v6 as well.
Also we think as improvement createFromDiscriminatorValue should be overwritten in each subclass with it's correct implementation (I think this is already done), but we don't understand why we have the need to manually pass the correct descriminator to the PageIterator. We believe this can be done automatically without manual interaction.
Our call currently looks like this using a similar PageIterator as seen in here:
We already pass a UserCollectionResponse but we don't understand why the PageIterator does not get it's discriminator automatically and we have to set it manually by passing the explicit discriminator.
Also we can't use var users = ..., because we need to declare the return type as Entity and can't get it from UserCollectionResponse since that class is not typed.
What do you think about this?
Describe the solution you'd like.
Already proposed above
Additional context?
No response
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe the problem.
We are trying to use v6 with generic methods to reduce duplicate boiler plate code, but struggle to do this efficiently. We struggled with the following:
This class seems to be part of each Builder class and there is not one abstract parent implementation for all Builder classes. We can't write a generic method handling each entity because there are hundreds of seperate GetRequestConfiguration implementations, e.g. one for UsersRequestBuilder and this method now can only be used for UsersRequestBuilder:
The same applies for PostRequestConfiguration and all other classes.
Here we see some problems:
Our call currently looks like this using a similar PageIterator as seen in here:
We already pass a UserCollectionResponse but we don't understand why the PageIterator does not get it's discriminator automatically and we have to set it manually by passing the explicit discriminator.
Also we can't use
var users = ...
, because we need to declare the return type as Entity and can't get it from UserCollectionResponse since that class is not typed.What do you think about this?
Describe the solution you'd like.
Already proposed above
Additional context?
No response
The text was updated successfully, but these errors were encountered: