-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Should Feed Escape work in Pydantic Models #3024
Comments
@killswitch-GUI doc at link, that you have provided, explicitly says: |
@insomnes I clearly asked if this would affect Pydantic models in my OpenAPI spec.. you neither answered my question or provided context to the question I'm asking. Also, I'm well aware of what the docs have... I searched over the Pydantic & FastAPI documentation carefully to make sure I wasn't coming here to piss people like @Kludex off... Simply put I want to maintain my development docs and keep my linters happy while excluding those nasty bits to my JSON schema like such: class Item(ModelWeOwn, SomeOtherModel):
"""Some nice model
\f
VERY Long internal description, use case etc.
Args:
ModelWeOwn (Type): Somthing
Return:
(Type): somthing
"""
name: str
description: Optional[str] = None
price: float
tax: Optional[float] = None
tags: Set[str] = []
@app.post("/items/", response_model=Item, summary="Create an item")
async def create_item(item: Item):
"""
Create an item with all the information:
- **name**: each item must have a name
- **description**: a long description
- **price**: required
- **tax**: if the item doesn't have tax, you can omit this
- **tags**: a set of unique tag strings for this item
\f
:param item: User input.
"""
return item |
@killswitch-GUI sorry, for some reason my brain omitted
part when i was answering your question. |
@killswitch-GUI There's no need to close the issue. That PR was not accepted yet. |
ok @Kludex |
Assuming the original need was handled, this will be automatically closed now. But feel free to add more comments or create new issues or PRs. |
Note that there is a bug in the implementation but there is a PR to fix it: #6039 |
I'm not seeing
\f
affecting the output of pydantic models in my OpenAPI spec as described here: https://fastapi.tiangolo.com/advanced/path-operation-advanced-configuration/ is this a bug I should open or just a limitation?The text was updated successfully, but these errors were encountered: