Example path:
"/api/v1/smtg/{smtg_id}"
delete:
operationId: delete_smtg
parameters:
- required: true
schema:
title: Id
type: integer
name: smtg_id
in: path
responses:
"204":
description: Successful Response
The code generated:
@app.delete("/api/v1/smtg/{smtg_id}", response_model=None)
def delete_smtg(
smtg_id: int,
) -> None:
pass
This code tells nothing about status code, so fastapi response status code is 200 instead of 204.
The code need to be generated:
@app.delete("/api/v1/smtg/{smtg_id}", status_code=204)
def delete_smtg(
smtg_id: int,
) -> None:
pass
This code tells fastapi to respond status code 204 not 200.
https://fastapi.tiangolo.com/tutorial/response-status-code/?h=status
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too