-
Notifications
You must be signed in to change notification settings - Fork 0
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
Update settings manangement, object orient endpoint and function import structure #20
Conversation
…int basic test - accept reformatting
Also, I have merged the test api files together in this :) |
… to handle what used to be routers
So, added an abc called EndpointRegister, the idea here is that each Register class will hold the relevant functions, and the Endpoint models attached, this can later be used to derive the "active" endpoints of the api, without the need for the user to define them when init'ing the OpenEOCore. The idea of the Register is to offer a similar modularization of the FastApi routers, but without having to actually use them in any way. Additionally, I had to update the settings management because of the reason mentioned in teams, I.E, init'ing them in the module code means those are set when the module is imported, this is okay for an application, but not really for a package. Also updated unit tests to make sure the endpoints called are actually behind the OPENEO_PREFIX value, as they all should be, besides get capabilities :) Happy to call and discuss this structure if there are any questions, the only other thing I might add is a RootRegister, for those endpoints that sit on the root path of the api (if you find the Register structure aggreable). |
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.
Initialising the settings when the Client is initialised makes sense. In general this looks much tidier than before, thanks! Looks good to me
def _initialize_endpoints(self) -> list[Endpoint]: | ||
return [ | ||
Endpoint( | ||
path="/collections", |
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.
do we need /{self.client.settings.OPENEO_VERSION}/
in the path here as well?
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.
Good shout, but I don't think here we want to add it. This is just about setting what we advertise in /capabilities, and we don't actually want the version number to be present when displayed as an output there. Additionally, I initially thought the same when doing the openeo-api-python and the openeo-clients couldn't discover the endpoints xD
…int basic test - accept reformatting
should resolve the issues around the conformance endpoint you have noticed