Skip to content
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

Proposal for prerender access #1957

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

vvmruder
Copy link
Contributor

@vvmruder vvmruder commented Mar 7, 2025

Overview

Related Issue / discussion

We promised the simple proposal already some time ago #1802, sorry for the delay.

Here it is. I try to showcase it with the landing page. The idea is pretty simple. We encapsulate all preparation into the fcm dictionary in a separate method called landing_page_prerender. We keep the original method and its signiture. This method then applies the rendering to the fcm dictionary as defined by the passed format. This would be done for all api-methods of course. This is just a showcase.

Why is that useful: Think of the possibilities here. We might want to add custom links to other resources in the webapplication via code of that web application. We want to completely omit pygeoapi rendering and take the fcm dictionary into custom responibiltiy to render it ourself.

In general have 2 architectural questions here:

  • why is pygeoapi is using simple methods here instead of class/subclass pattern? A class/subclass pattern would make it more easy to define a general pattern and allows overwriting of class methods via subclassing.
  • When we are able to use the fcm dictionary as proposed: The next logical step would be nice typing through e.g. dataclasses to make handling straigt forward. I refer to Use Protocol interfaces and static duck typing design pattern #1547, what is the status here? Still happy to support work on that topic.

Additional information

Dependency policy (RFC2)

  • I have ensured that this PR meets RFC2 requirements

Updates to public demo

Contributions and licensing

(as per https://github.com/geopython/pygeoapi/blob/master/CONTRIBUTING.md#contributions-and-licensing)

  • I'd like to contribute [feature X|bugfix Y|docs|something else] to pygeoapi. I confirm that my contributions to pygeoapi will be compatible with the pygeoapi license guidelines at the time of contribution
  • I have already previously agreed to the pygeoapi Contributions and Licensing Guidelines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant