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

WIP: sketch geojson support #171

Closed
wants to merge 2 commits into from
Closed

WIP: sketch geojson support #171

wants to merge 2 commits into from

Conversation

vincentsarago
Copy link
Member

ref: #166

response_model_exclude={"minzoom", "maxzoom", "center"},
response_model_exclude_none=True,
responses={200: {"description": "Return dataset's basic info."}},
)
def info(
src_path=Depends(self.path_dependency),
accept: Optional[JsonType] = Header(None),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tests are failing because by default we send content="*/*" which is not a member of JsonType

Having a defined accept values plays nice with OpenAPI but is too restrictive (?).

I'm not sure what's the best here, IMO just having as_geojson=True option would be simpler 🤷

cc @geospatial-jeff

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm I've never been a fan of how fastapi handles */*. Also you can't subclass enums which makes things difficult.

I think maybe separate info.json and info.geojson routes makes the most sense for now. It's definitely less standard but we already are using a pattern that doesn't rely on the accept header but instead the postfix of the route (ex /tilejson.json). So I'd say let's keep going with that pattern to keep things consistent.

I would definitely prefer an accept header longer term (its more standard HTTP), but maybe that is outside the scope of this PR. Switching to the use of an accept header to dictate api behavior seems like a larger topic.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏 thanks @geospatial-jeff .json .geosjon 👌

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.

2 participants