api2go
api2go copied to clipboard
/x/net/context based routing
I have been working on an old fork of ours to convert your routing system to make using golang.org/x/net/context a lot easier for extending functionality of api2go with custom routes.
Only thing is it would introduce breaking changes on routes and middleware. The nice things is that it would allow any new routes to have access to whatever the middleware sets in the context.
Let me know what you think and if you would like something based of your master branch.
hi, yes that makes sense. Currently, the Context can only be reached in our CRUD functions, because you can get it out of the Request struct.
We just have to make sure that everything all the api2go-adapters works with that too.
So if I manage to get api2go-adapters working with my solution would you consider it a viable solution @wwwdata
yes. What do you think about it @sharpner ?
yeah that would be awesome. Also I agree, it has to work with the routers. But BC breaks are not that problematic at the moment.
Cool I will work on this then
thank you! Much appreciated!
I'm really looking forward too for ability to define alternative routes and still benefit from the data that is available to api2go automatically - defined resource routes.
For example, to be able to POST to /order/11/line instead of (or additionally to) posting to /lines and adding order id as a relationship in the POST body)
@arcijsg I am doing what I can for this. We are using api2go at work and it's seems like it might become a priority to get this done. Work has been busy.
@abrykajlo, did You have a chance to find a solution, or a different approach has emerged since?