You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used the GitHub search to find a similar question and didn't find it.
I searched the FastAPI documentation, with the integrated search.
I already searched in Google "How to X in FastAPI" and didn't find any information.
I already read and followed all the tutorial in the docs and didn't find an answer.
I already checked if it is not related to FastAPI but to Pydantic.
I already checked if it is not related to FastAPI but to Swagger UI.
I already checked if it is not related to FastAPI but to ReDoc.
Commit to Help
I commit to help with one of those options 👆
Example Code
fromfastapiimportFastAPIapp=FastAPI()
@app.post("/lof")deffoo(arg: int=5) ->int:
""" Some function.\f Args: arg: Some argument Returns: Some integer. """returnarg
Description
Running ruff==0.1.3 on this, D301 will autofix to make the docstring be a raw string (lead by r).
@app.post("/lof")deffoo(arg: int=5) ->int:
r""" Some function. \f Args: arg: Some argument Returns: Some integer. """returnarg
Discussed in #10531
Originally posted by jamesbraza October 26, 2023
First Check
Commit to Help
Example Code
Description
Running
ruff==0.1.3
on this,D301
will autofix to make the docstring be a raw string (lead byr
).However, this breaks the form feed
\f
truncation from working, per https://fastapi.tiangolo.com/advanced/path-operation-advanced-configuration/#advanced-description-from-docstringI think form feed
\f
truncation should still work even if the docstring is a raw string.Operating System
macOS
Operating System Details
n/a
FastAPI Version
0.104.0
Pydantic Version
2.4.2
Python Version
3.11.5
Additional Context
No response
The text was updated successfully, but these errors were encountered: