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

Sometimes I want an HttpResponse and sometimes a deserialized object #110

Open
mattiasnordqvist opened this issue Jan 22, 2021 · 3 comments

Comments

@mattiasnordqvist
Copy link
Owner

Sometimes I want an HttpResponse and sometimes a deserialized object, do I have to write another method signature then? I don't like it. What can we do?

@carl-berg
Copy link
Collaborator

I don't mind it myself, but it seems that it can cause problems. I've came across code bases where one would use Task<HttpResponseMessage> because they did not care about the response but still assumed that the success-check was made so potentially there would be failed requests that nobody was aware of. The "correct" way to handle this in WebAnchor is to just use Task as return type, which is described in the documentation, but might not be clear enough if you're just looking at the the exposed programming api...

@mattiasnordqvist
Copy link
Owner Author

I think we could type parameterize each and every signature, so you can, at runtime, specify what return type you want. What do you think?

@mattiasnordqvist
Copy link
Owner Author

Maybe it is already possible?

@mattiasnordqvist mattiasnordqvist added this to Ideas in WebAnchor v7 Feb 3, 2021
@mattiasnordqvist mattiasnordqvist moved this from Ideas to ToDo in WebAnchor v7 Feb 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

2 participants