-
Notifications
You must be signed in to change notification settings - Fork 18
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
Provide Intent Oriented Syntax #1
Comments
I would prefer method chaing instead of properties, something like:
This way I find the alias/shortcut more obvious. |
Makes sense to me. Next the next question is : which use cases should be supported through shortcuts. Should we list broad categories (such as 2xx = with success, 3xx = WithRedirect, 4xx = WithRrror, 5xx=WithServerError) , or dig into more specifics (404=WithNotFound)? |
Thanks for the feedback |
We definitely need both shortcuts for the most beaten paths as well as the ability to be very specific for the edge cases. In order to favor the 'pit of success' factor, one need to makes what is frequently used easy and what is less frequent possible. So I would propose: Responses.WithSuccess() // ok for any 2xx code
Responses.WithOk() // ok if code = 200
Responses.WithSuccess().AndCode(2xx) // ok for code 2xx
Responses.WithError() // ok for any 4-5xx
Responses.WithNotFound() // ok for 404
Responses.WithInternalError() // ok for 5xx
Responses.WithSpecific().ForCode(xxx) // ok for code xxx see the idea. Writing those samples, I realize I feel there is a wording issue with 'Responses'. But I will open a new issue to discuss it |
Added test for searching body using wildcards
I would like to have a syntax that focuses on intent to improve further on readability. So instead of
I would prefer
other example
I think it may also be helpful when you want to simulate ill behaving servers
The text was updated successfully, but these errors were encountered: