mirror of https://github.com/tiangolo/fastapi.git
18 lines
300 B
Python
18 lines
300 B
Python
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
|