-
Notifications
You must be signed in to change notification settings - Fork 284
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 support for attribute functions to REST interfaces #349
Conversation
I am unlikely to do any coding in next 4 or 5 days so please don't hurry with reviewing and merging this ;) |
Sorry, I interfered with the pull request when fixing two small regressions. But it looks good AFAICS and I'll test and merge in the evening today. The only thing is the "index" deprecation that I'd keep for a little longer. DDOX will also need to get proper support for documented unit tests (not sure what DMD writes to the JSON file in that case). But this needs to be done anyway, of course. |
P.S. Are there any additional documentation updates needed somewhere? (I have never paid much attention to vibed.org update process) |
Since there is no high level (non-DDOC) documentation for the rest module, nothing needs to be updated currently. Otherwise it would be in docs.dt. My brief tests have shown no issues, so this is good to be merged. Can you issue a rebase of your branch? In case you get a conflict, my only change was in the first line of |
Change DDOC example for registerRestInterface into documented unit-test, reformat it for better readability. Add method for URLRouter to check registered routes. Implement standard way for URL formatting using stand-alone function
Maybe I should add one? It has got rather complex... Rebased and also removed |
Adapt everything to vibe.d standard code style Localize imports Improve formatting where it helps readability
1) Add new calling overload in AttributedFunction so that it won't try merging parameter and attribute type tuples when incoming and target parameter type tuples match exactly. In that cases relevant parameters are simply overwritten by attached attribute functions. 2) Add diagnostic that all attached InputAttribute functions conform to stored argument list. 3) static imports added for qualified symbols
Also makes test suite exit upon both success and failure
Add support for attribute functions to REST interfaces
It definitely makes sense to have a section for this, but I'd keep it relatively high level there (since that page is something more like a quick overview of everything). |
Actual change necessary for
funcattr
support is minimal (e6a98a9), which indicates that currentvibe.utils.meta.funcattr
design is quite solid. Some defects in original pull have been found and fixed (361005b)However, there are also plenty of somewhat unrelated changes in
vibe.http.rest
as I couldn't pass by by without yet another attempt to make it more readable:Each commit should be compilable on its own and can be reviewed independently.
Example of resulting API copied from test suite: