FastAPI — @Schema(hidden=True) не работает при попытке скрыть раздел схемы в документах SwaggerPython

Программы на Python
Гость
FastAPI — @Schema(hidden=True) не работает при попытке скрыть раздел схемы в документах Swagger

Сообщение Гость »


I'm trying to hide the entire schemas section of the FastAPI generated swagger docs. I've checked the docs and tried this but the schema section still shows.

Код: Выделить всё

    @Schema(hidden=True)     class theSchema(BaseModel):         category: str 
How do I omit one particular schema or the entire schemas section from the returned swagger docs.

docExpansion does not appear to work either. What am I missing?

Код: Выделить всё

app = FastAPI(     openapi_tags=tags_metadata,     title="Documentation",     description="API endpoints",     version="0.1",     docExpansion="None" )  


Источник: https://stackoverflow.com/questions/707 ... ema-sectio

Вернуться в «Python»