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 code examples in docs for body, replace namecreate_item withupdate_item when appropriate#5913
Conversation
📝 Docs preview for commitc9d3b22 at:https://63ccee9f0fb8da5c9c02fac2--fastapi.netlify.app |
📝 Docs preview for commitdc6946f at:https://63ccf0f8cf78ab6745a882e4--fastapi.netlify.app |
r0b2g1t left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
Looks good for me.
Ryandaydev left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
Tests pass.
The changes listed as "1" are good changes.
I understand the suggestion for "2", however I suggest not making those changes because that code is repeated in multiple places throughout the tutorials. As I understand the tutorials, they build on each other somewhat, and they focus on specific items in each section. It seems to me that making these changes in a few places adds inconsistencies that the learner has to investigate as they change. It may be more useful to keep it consistent even if the example isn't optimal?
OttoAndrey commentedJan 23, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@Ryandaydev First time when learner see this @app.get("/items/{item_id}")asyncdefread_items(q:str|None,item_id:int=Path(title="The ID of the item to get")):results= {"item_id":item_id}ifq:results.update({"q":q})returnresults |
Ryandaydev 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.
I understand the reasoning on this change. Also, the tests still pass.
Uh oh!
There was an error while loading.Please reload this page.
📝 Docs preview for commit2bfa458 at:https://64697a4de93dbc10f72678bd--fastapi.netlify.app |
OttoAndrey commentedMay 21, 2023
Ok. I removed controversial changes and left only renamed functions |
create_item withupdate_item when appropriatetiangolo commentedJan 9, 2024
Nice, makes sense, thank you@OttoAndrey! 🍰 And thanks everyone for the input! ☕ |
Uh oh!
There was an error while loading.Please reload this page.
Hi! I did some improvements for code exmples;
putendpoint and logicaly it should beupdatenotcreate;Removed redundantifstatement becauseqparam in those examples are required. Or I can addNoneto annotations;