-
Notifications
You must be signed in to change notification settings - Fork 130
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
Custom dynamic endpoints #404
Comments
Are you talking about a Falcon/Flask-like pre_request and post_response hooks? This can be done programmatically using the Flask interface. |
Yes, something very similar to that.
I don't know exactly how. But if we are talking about maybe @chrizandr can better explain what we actually want |
IMHO we need to consolidate the existing functionalities before getting into improving the developer experience. Please run a double-check (a checklist maybe) about what it is currently usable in hydrus and what it is in the spec. I feel we still have something else to do before starting with adding features to improve the developer experience. We need a comparative overview of the current state and what we can provide to developers, for example:
|
What I meant by dynamic endpoints was for developers to be able to decide how the incoming data is to be processed. Right now, the only functionality that hydrus provides is for developers to be able to store data in a database without being able to control how the data is processed at the server end. There is nowhere that a developer can insert custom code to be able to create a full fledged server for their needs. I had something like Django's class based views in mind. We agree on a common input/output format(Hydra in our case) to be served using REST based HTTP, but also provide developers an option to introduce their own code to process the incoming data as per their own use cases. A few examples I could think of is are cases where updates in the API data/resources need to be communicated to another service, custom function calls when certain type of data is inserted into the server, etc. These things are too broad for us to generalise and it would be good if we allow developers to use hydrus as a stack, which is what our ultimate goal is. I feel that what we have now allows for very little modification from developers and they need to us it as is, out of the box. This would make it hard for others to integrate Hydra into their existing APIs with hydrus. |
Is this something similar to use |
Yes but those are more general to be done after every request. What if the processing needs to be done specific to an endpoint? We are offering hydrus as a library to developers, where they only use a small script(the demo script in the docs) to create a hydra enabled server. What I had in mind was a full scale stack that allows developers to add hydra to their existing applications with minimal effort. There is custom code that needs to be added on every specific endpoint. Right now, there is no mechanism that allows people to do that, other than changing the hydrus source code for their needs. We need an interface for people to insert functionality wherever they need it. This is a much more complicated and broader task, but I figure that we need to start working towards this. |
the functions have been defined in app.py and not been imported from any other file is to avoid the circular dependency issues in flask at the prototype stage. I will fix this issue once the prototype is accepted related to HTTP-APIs#404
the functions have been defined in app.py and not been imported from any other file is to avoid the circular dependency issues in flask at the prototype stage. I will fix this issue once the prototype is accepted related to HTTP-APIs#404
the functions have been defined in app.py and not been imported from any other file is to avoid the circular dependency issues in flask at the prototype stage. I will fix this issue once the prototype is accepted related to HTTP-APIs#404
I'm submitting a
Current Behaviour:
Right now, hydrus only serves static data and provides standard CRUD operations over
that data, it doesn’t allow the user to define some logic to process incoming data and
provide generated output.
Expected Behaviour:
hydrus should provide some way to define dynamic endpoints, and thus let users define
logic to process incoming data.
The Command Dispatcher Pattern and can be used. The developer can create a Command_dispatcher class having commands(extra logic) as
methods ( following some protocol), then it can be passed to hydrus where hydrus will
form commands according to the protocol and check whether the given (command_dispatcher) object has that attribute or not, if yes then get that attribute (method) and execute it.
Steps to reproduce:
Do you want to work on this issue?
Yes
The text was updated successfully, but these errors were encountered: