Port a few more endpoints to the typed API#466
Conversation
Codecov Report
@@ Coverage Diff @@
## main #466 +/- ##
==========================================
- Coverage 80.48% 80.46% -0.02%
==========================================
Files 188 188
Lines 11087 11140 +53
Branches 1076 1079 +3
==========================================
+ Hits 8923 8964 +41
- Misses 2150 2162 +12
Partials 14 14
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
I agree that POST should alway have a JSON payload, even though sometimes it can be empty. |
cguedes
left a comment
There was a problem hiding this comment.
Approved with a note about the create project payload (querystring vs post body). We should update that later.
|
|
||
| @references_api.post("/{project_id}") | ||
| async def ingest_references(project_id: str): | ||
| async def ingest_references(project_id: str, payload: EmptyRequest) -> IngestResponse: |
| @project_api.post("/") | ||
| async def create_project(project_name: str, project_path: str = None): | ||
| async def create_project( | ||
| payload: EmptyRequest, project_name: str, project_path: str = None |
There was a problem hiding this comment.
nit: We should move the project_name and project_path to inside a request payload instead of using the EmptyPayload. This was an oversight when I first reviewed this.
There was a problem hiding this comment.
I did this change when I merged the from main.
I filled in the FastAPI / Pydantic schemas in a few places. Note that POST requests need a JSON payload with this system. If we want to support empty payloads, we'll need to add some more logic in
typed-api.ts.