mirror of
https://github.com/fastapi/fastapi.git
synced 2026-03-28 11:45:33 -04:00
📝 Update source examples to use new JSON Schema examples field (#9776)
* 📝 Update source examples to use new JSON Schema examples field * ✅ Update tests for JSON Schema examples * 📝 Update highlights in JSON Schema examples
This commit is contained in:
committed by
GitHub
parent
983f1d34db
commit
4d83f984cc
@@ -23,29 +23,18 @@ async def update_item(
|
||||
Body(
|
||||
examples=[
|
||||
{
|
||||
"summary": "A normal example",
|
||||
"description": "A **normal** item works correctly.",
|
||||
"value": {
|
||||
"name": "Foo",
|
||||
"description": "A very nice Item",
|
||||
"price": 35.4,
|
||||
"tax": 3.2,
|
||||
},
|
||||
"name": "Foo",
|
||||
"description": "A very nice Item",
|
||||
"price": 35.4,
|
||||
"tax": 3.2,
|
||||
},
|
||||
{
|
||||
"summary": "An example with converted data",
|
||||
"description": "FastAPI can convert price `strings` to actual `numbers` automatically",
|
||||
"value": {
|
||||
"name": "Bar",
|
||||
"price": "35.4",
|
||||
},
|
||||
"name": "Bar",
|
||||
"price": "35.4",
|
||||
},
|
||||
{
|
||||
"summary": "Invalid data is rejected with an error",
|
||||
"value": {
|
||||
"name": "Baz",
|
||||
"price": "thirty five point four",
|
||||
},
|
||||
"name": "Baz",
|
||||
"price": "thirty five point four",
|
||||
},
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user