-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Add NullableResponse<T>
that Response<T>
inherits from
#27852
Comments
DPG protocol methods only return |
Per offline conversation, this isn't required for DPG GA. We'll address it once we start adding the |
Note: This could affect any extensions to Response
|
Response<T>
requires thatT Value
is not null. When we want to work around that and return aResponse<T>
with noValue
(like conditional requests that return 3XX, batching requests that haven't been sent to the service yet, DPG errors that were classified as success, ...) we usuallythrow
when accessed. See NoBodyResponse and ErrorResponse as examples.While that technically meets the contract for
Response<T>
, it doesn't match the spirit of it. We'd like to introduce aNullableResponse<T>
that we can start using for this case. To avoid a bifurcated response hierarchy, we'd like to make the existingResponse<T>
inherit from it. Here's a rough example of what the API might look like:We also want to evaluate whether DPG protocol methods (and anything accepting
RequestContext
) should return thisNullableResponse<T>
instead of regularResponse<T>
.The text was updated successfully, but these errors were encountered: