-
Notifications
You must be signed in to change notification settings - Fork 12
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
Conformance classes instead of endpoint list #506
Comments
In python client, there are two explicit cases of checking the endpoints:
Apart from that, there is also a user facing API to list and check endpoints (e.g. |
In the aggregator:
The aggregator generates its own endpoint listing independently from the endpoint listings of upstream backends. Apart from that I couldn't find anything else that could be relevant here |
In general, I kind of like the old style with explicit |
I think we'll need to adopt this at some point for alignment with OGC APIs and deprecate our endpoint list. We can probably simplify it, so that it's easier to translate endpoints to URLs 1:1 (i.e. it uses a template So for example: {
"conformsTo": [
"https://api.openeo.org/1.2.0",
"https://api.openeo.org/1.2.0/endpoints/get/collections",
"https://api.openeo.org/1.2.0/endpoints/get/collections/{collection_id}",
"https://api.openeo.org/1.2.0/endpoints/get/processes",
"https://api.openeo.org/1.2.0/endpoints/get/jobs",
"https://api.openeo.org/1.2.0/endpoints/post/jobs",
"https://api.openeo.org/1.2.0/endpoints/get/jobs/{job_id}",
"https://api.openeo.org/1.2.0/v/delete/jobs/{job_id}",
"https://api.openeo.org/1.2.0/endpoints/patch/jobs/{job_id}",
"https://api.openeo.org/1.2.0/endpoints/get/credentials/basic",
"https://api.openeo.org/extensions/commercial-data/0.1.0",
"https://api.openeo.org/extensions/federation/0.1.0",
"https://api.stacspec.org/v1.0.0/collections"
]
} so for example if you have def supports(method: str, path: str) -> bool:
escaped_path = path.replace("{", "\{").replace("}", "\}")
method = method.lower()
pattern = f"https://api.openeo.org/[^/]+/{method}/{escaped_path}"
for c in conformsTo:
if c.match(pattern):
return True
return False
supports("GET", "/collections") |
I'm fine with this if it's acceptable to just (naively) parse the listed conformsTo URLs, without having to actually request them and inspect their responses |
Sure, conformance classes often don't resovle in OGC land anyway. They will likely just give 404s or resolve to something that's not overly useful... |
I'm wondering whether we can "easily" align better with OGC APIs by deprecating the
endpoints
entry inGET /
and replace it with conformance classes in the long-term (2.0). In the short term (1.x) we would deprecate the existing functionality and add the new one.I could imaging it working like this: Instead of specifying the method and path, you use the operation ID specified in the OpenAPI document.
For this I'm wondering, what the endpoint list is currently used for and by which software component.
Example
Before
After
Thoughts?
The text was updated successfully, but these errors were encountered: