Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.7k
📝 Update Request Body'stutorial002 to deal withtax=0 case#13230
📝 Update Request Body'stutorial002 to deal withtax=0 case#13230tiangolo merged 3 commits intofastapi:masterfrom
tutorial002 to deal withtax=0 case#13230Conversation
…tax=0Before 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
📝 Docs preview for commit4fed048 at:https://e2e4d18f.fastapitiangolo.pages.dev |
tutorial002_py310.py fortax=0 situationtutorial002_py310.py fortax=0 situationtutorial002 to deal withtax=0 case
svlandeg left a comment
There was a problem hiding this 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 wheretax is explicitely0.0. I've gone ahead and pushed the same edit also totutorial002.py to keep both files in sync.
📝 Docs preview for commitaf4029d at:https://dfabdbdc.fastapitiangolo.pages.dev |
📝 Docs preview for commitd7417b9 at:https://d29af659.fastapitiangolo.pages.dev |
tiangolo left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Thanks! 🤓
9667ce8 intofastapi:masterUh oh!
There was an error while loading.Please reload this page.
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