-
Notifications
You must be signed in to change notification settings - Fork 106
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
refactored conformance classes for extensions #790
refactored conformance classes for extensions #790
Conversation
FILTER = "https://api.stacspec.org/v1.0.0-rc.1/collection-search#filter" | ||
QUERY = "https://api.stacspec.org/v1.0.0-rc.1/collection-search#query" | ||
SORT = "https://api.stacspec.org/v1.0.0-rc.1/collection-search#sort" | ||
FIELDS = "https://api.stacspec.org/v1.0.0-rc.1/collection-search#fields" |
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.
Those have been moved to each extensions Enums (will update the changelog to mention it)
] | ||
for ext in extensions: | ||
if conf := known_extension_conformances.get(ext.__class__.__name__, None): | ||
conformance_classes.append(conf) | ||
conformance_classes.extend(ext.conformance_classes) |
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.
we now extend the conformance classes with the classes found within the extensions
|
||
SEARCH = "https://api.stacspec.org/v1.0.0-rc.2/item-search#filter" | ||
ITEMS = "http://www.opengis.net/spec/ogcapi-features-3/1.0/conf/features-filter" | ||
COLLECTIONS = "https://api.stacspec.org/v1.0.0-rc.1/collection-search#filter" |
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.
For consistency, most extension will have search
, items
and collections
response_class=self.response_class, | ||
endpoint=create_async_endpoint(self.client.get_queryables, EmptyRequest), | ||
) | ||
app.include_router(self.router, tags=["Filter Extension"]) |
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.
the search extension only register the /queryables
endpoint
Returns: | ||
None | ||
""" | ||
pass |
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.
maybe worth for add a note about why we're not registering default endpoint here
ITEMS_ADVANCED = ( | ||
"https://api.stacspec.org/v1.0.0-rc.1/ogcapi-features#advanced-free-text" | ||
) | ||
COLLECTIONS_ADVANCED = ( | ||
"https://api.stacspec.org/v1.0.0-rc.1/collection-search#advanced-free-text" | ||
) |
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.
just re-ordering entries (to have search/items/collections)
""" | ||
|
||
ITEMS = "https://api.stacspec.org/v1.0.0/ogcapi-features/extensions/transaction" | ||
COLLECTIONS = "https://api.stacspec.org/v1.0.0/collections/extensions/transaction" |
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.
here is an example of full application https://gist.github.com/vincentsarago/4ee0fdf471cf592a8ba642dcc72304d2#file-app-py |
Don't really have time to fully review right now, sorry. If you have specific things you want me to check though, please let me know. |
the changes are quite |
Makes sense to me. |
while working on stac-utils/stac-fastapi-pgstac#192 I realized the
extensions
where designed first for/search
endpoints and might lead to some issues within the application conformance classes list.This PR aims to create extensions with correct conformances classes but also makes customization easier.
Changelog:
collection_search.ConformanceClasses
->collection_search.CollectionSearchConformanceClasses
collection_search.CollectionSearchPostExtension.from_extension(ext)
method will now use the conformance classes from the input extensions to derived the output conformance classes.fields.FieldsConformanceClasses
Enumfilter.FilterConformanceClasses.FEATURES_FILTER
->filter.FilterConformanceClasses.ITEMS
filter.FilterConformanceClasses.ITEM_SEARCH_FILTER
->filter.FilterConformanceClasses.SEARCH
filter.FilterConformanceClasses.COLLECTIONS
filter.SearchFilterExtension
,filter.ItemCollectionFilterExtension
andfilter.CollectionSearchFilterExtension
endpoint specific extensionsFreeTextConformanceClasses.COLLECTIONS
andFreeTextConformanceClasses.ITEMS
inFreeTextExtension
andFreeTextAdvancedExtension
default conformances classesquery.QueryConformanceClasses
EnumSortConformanceClasses
Enum