Skip to content

Need a new way to declare behaviour and modification of API from extensions #178

Open
@rsmith013

Description

@rsmith013

While writing code to add the filters extension it became clear that it was difficult for downstream applications to dynamically register the extensions they implement and for this to modify the response without also needing to update the implementation.

There are 3 things that extensions do in the call/response flow:

  1. Add an additional, stand-alone endpoint
  2. Modify the response from an existing endpoint
  3. Modify the queryset behind the response on an existing endpoint

The current framework works well with additional, stand-alone modifications. The other two rely on adding:

if self.extension_is_enabled(<ExtensionClass>):
     # Do something

constructs from within the "Core" client.

It would be nice if extensions define the logic and perhaps some base implementation or abstract implementation for the additions and modifications to the basic STAC API implementation.

Of course, depending on the extension, some implementation-specific code would need to be written to define the interaction between the extension and the database but it would be good to be able to keep this out of the core.

I will continue to have a think about how this might be accomplished and will make a PR if I come up with anything, but as this will be significant work, it would be good to get some feedback. Or if someone else wants to make a start... 😉

Would also impact #175

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions