pythonasyncioapiasyncfastapiframeworkjsonjson-schemaopenapiopenapi3pydanticpython-typespython3redocreststarletteswaggerswagger-uiuvicornweb
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
300 B
17 lines
300 B
from typing import List
|
|
|
|
from fastapi import FastAPI
|
|
from pydantic import BaseModel
|
|
from pydantic.types import UrlStr
|
|
|
|
app = FastAPI()
|
|
|
|
|
|
class Image(BaseModel):
|
|
url: UrlStr
|
|
name: str
|
|
|
|
|
|
@app.post("/images/multiple/")
|
|
async def create_multiple_images(*, images: List[Image]):
|
|
return images
|
|
|