@wilmer.lemke
To disable schema checking in FastAPI, you can set the response_model
parameter to None
in your endpoint function. This will prevent FastAPI from validating the response data against the declared schema.
For example:
1 2 3 4 5 6 7 |
from fastapi import FastAPI app = FastAPI() @app.get("/items", response_model=None) async def get_items(): return [{"name": "Item 1"}, {"name": "Item 2"}] |
In this example, the response_model
is set to None
, so FastAPI will not validate the response data against any schema.