fix(tiles): pass server templates to render_j2_template for TMS endpoints - #2428
Open
C1-BA-B1-F3 wants to merge 2 commits into
Open
C1-BA-B1-F3 wants to merge 2 commits into
C1-BA-B1-F3 wants to merge 2 commits into
Conversation
PostgreSQL and MongoDB managers ignored the limit and offset parameters, returning all jobs regardless of the query string. Apply offset before limit in both backends, matching the existing TinyDB behaviour. Fixes geopython#2426
…ints The tilematrixsets and tilematrixset HTML handlers passed api.tpl_config as the template configuration, but that dict carries the full server config (including 'server') and lacks the 'path' key that render_j2_template expects. The lookup therefore always fell back to the default templates, ignoring any custom theme. Pass api.config['server']['templates'] instead, matching every other render_j2_template call site. Fixes geopython#2422
Contributor
Author
|
The The two failing tests exercise Happy to rebase once upstream fixes the CI environment. |
2 tasks done
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The
tilematrixsetsandtilematrixsetHTML handlers passedapi.tpl_configas the template configuration:But
api.tpl_configis a deep copy of the full server config (it hasserver,metadata, etc.) and lacks thepathkey thatrender_j2_templateexpects. Thetry/except (KeyError, TypeError)inrender_j2_templatethen silently fell back to the default templates, so any custom theme was ignored.Every other call site passes
api.config['server']['templates'](which has thepathkey). This PR aligns the two TMS handlers to the same pattern.Changes
pygeoapi/api/tiles.py:tilematrixsets()andtilematrixset()now passapi.config['server']['templates']torender_j2_templateTest plan
templates/tilematrixsets/are now picked up (the issue reporter's hand-drawn theme).Fixes #2422