I'm asking for an option to set the api paths and schema to be collapsed by default, essentially docExpansion = 'none'.
Ideally we could set it like this:
app = FastAPI(
title='My Killer Web App',
description='love FastAPI with whole heart!',
version='2.0.0',
docExpansion='none'
)
If there is already a way to do this I'd love to know, as I've already looked through the FastAPI documentation and performed hours of google searches in an attempt to discover how to do this in FastAPI, with no luck.

I'm not sure if this helps for the time being: https://fastapi.tiangolo.com/advanced/extending-openapi/
@Kludex Thanks for sharing but this doesn't really help. Seems to lead me down a rabbit hole.
I am afraid that you will have to customize the HTML to do that. If you read the documentation above where you get the HTML of thr page, that's where it is.
Thanks @phy25 Do you have an example how to do this? The reference you share doesn't really convey how it is done, especially for somebody, like myself, that has limited experience with swagger. From an objective perspective, it still seems adding a convenient, simplistic way to do this in FastAPI is warranted. Unless the customize HTML method is simple in and of itself.
Any tracking on this yet?
I don't think anyone is working on it. Someone on our Gitter has created a customized one with your request, but the functionality itself is not implemented as part of FastAPI and I'm not sure a PR with this option will be accepted. Need to check with @tiangolo
@Kludex @phy25 @tiangolo I was able to get it to work using a local static js file and manipulating it. It wasn't too bad. Thanks y'all for pointing me in the right direction.
Thanks for the help here everyone! :clap: :bow:
Thanks @nrccua-timr for reporting back and closing the issue :heavy_check_mark:
@nrccua-timr could you please share your solution? I would be interested to do the same thing. Thanks
checkout this link on how to do it https://fastapi.tiangolo.com/advanced/extending-openapi/#download-the-files. Instead of having FastAPI download the swagger-ui-bundle.js file at runtime you will need to instead copy the file locally and incorporate it in your codebase, thus modifying the docExpansion value to None.
Most helpful comment
checkout this link on how to do it https://fastapi.tiangolo.com/advanced/extending-openapi/#download-the-files. Instead of having FastAPI download the swagger-ui-bundle.js file at runtime you will need to instead copy the file locally and incorporate it in your codebase, thus modifying the docExpansion value to None.