Skip to content

📝 Update Request Body's tutorial002 to deal with tax=0 case#13230

Merged
tiangolo merged 3 commits intofastapi:masterfrom
togogh:patch-1
Jan 30, 2025
Merged

📝 Update Request Body's tutorial002 to deal with tax=0 case#13230
tiangolo merged 3 commits intofastapi:masterfrom
togogh:patch-1

Conversation

@togogh
Copy link
Contributor

@togogh togogh commented Jan 18, 2025

Before this commit, price_with_tax was not included in the response body when tax=0, because the "if item.tax" condition gets set to false

image

Changing the condition to "if item.tax is not None" solves this issue

image

…tax=0

Before this commit, price_with_tax was not included in the response body when tax=0, because the "if item.tax" condition gets set to false. Changing the condition to "if item.tax is not None" solves this issue
@github-actions github-actions bot added the docs Documentation about how to use FastAPI label Jan 18, 2025
@github-actions
Copy link
Contributor

📝 Docs preview for commit 4fed048 at: https://e2e4d18f.fastapitiangolo.pages.dev

@svlandeg svlandeg changed the title bugfix: updated tutorial002_py310.py for tax=0 situation 📝 Update Request Body tutorial002_py310.py for tax=0 situation Jan 23, 2025
@svlandeg svlandeg changed the title 📝 Update Request Body tutorial002_py310.py for tax=0 situation 📝 Update Request Body's tutorial002 to deal with tax=0 case Jan 23, 2025
@svlandeg svlandeg self-assigned this Jan 23, 2025
Copy link
Member

@svlandeg svlandeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, makes sense to fine-tune this docs example to cover the case where tax is explicitely 0.0. I've gone ahead and pushed the same edit also to tutorial002.py to keep both files in sync.

@github-actions
Copy link
Contributor

📝 Docs preview for commit af4029d at: https://dfabdbdc.fastapitiangolo.pages.dev

@svlandeg svlandeg removed their assignment Jan 23, 2025
@github-actions
Copy link
Contributor

📝 Docs preview for commit d7417b9 at: https://d29af659.fastapitiangolo.pages.dev

Copy link
Member

@tiangolo tiangolo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! 🤓

@tiangolo tiangolo merged commit 9667ce8 into fastapi:master Jan 30, 2025
47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation about how to use FastAPI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants