-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
Multi return #137
Multi return #137
Conversation
97643be
to
5fcf04f
Compare
ff90e44
to
6575e90
Compare
This is a lot cleaner and I think it is ready to merge. Examples of the new features in Another thing is missing : when using this new |
Will look at it at the end of the week. 😄 |
Ready for review ✅ The generated OpenAPI schema should be correct. When using This allow to work on classic "view" (from MVC pattern) routes and create an API at the same time. I was playing with this feature the last few weeks and it is very helpful. |
Will be looking at this Sunday night. Day job got in the way this week |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is super clean and very clear. Just a few comments to address.
Spec
Currently, return type is either JSON or XML for the whole app. This needs to be improved.
The route /recipes should send HTML with a list of recipes if the
Accept
Header is "text/html", or JSON if theAccept
Header is "application/json", or XML if theAccept
Header is "application/xml". This allows to build a traditional website in the same time as building an API.This change is of course backward-compatible and existing controller will not change current behaviour. Performance should also not be degraded.
Example
A controller might look like this (see
multi_return_test.go
for more examples).