stac-utils / stac-utils/stac-fastapi

What is the purpose of _create_endpoint?

Open
#274 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

api layer
Dominant language
Python
Stars
324
Forks
126
Avg merge
1d 22h
Merged PRs (30d)
10

Description

While looking at #272, we are trying to find a way to have URL parameters and POST request body defined in the openAPI docs. I am having trouble understanding the code which follows _create_endpoint.

  • What is its intention?
  • What problem is it trying to solve?

There seems to be a link between it and **kwargs usage but can't see a reason to keep them in as query_params can be retrieved from the starlette.request object. e.g. request.query_params. We are pondering creating a PR that removes the _create_endpoint and potentially would mean that the URI classes also can go.

Simplification is probably a win but only if it doesn't remove functionality that is necessary and intentional.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in stac_fastapi/api/stac_fastapi/api/app.py at _create_endpoint, then review the related discussion in #272 and the Starlette request behavior referenced here. Determine what purpose _create_endpoint and the URI classes serve, and document whether removing them would preserve URL parameters, POST bodies, and OpenAPI generation.

Written by the indexing model from the issue text.

Assessment

Tech stack
fastapi, openapi, python
Domain
api, backend-api-design
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.