Prompt
My API docs are not updating when the OpenAPI file changes
Latest observation
Oct 16, 2026
OpenAI APIWeb search: off
This usually comes down to one of a few things:
1) The docs are cached
If you’re serving Swagger/OpenAPI docs through a browser or CDN, it may still be using an old cached version.
Try:
- Hard refresh the browser
- Clear browser cache
- Disable any reverse-proxy/CDN caching
- Add cache-busting headers if needed
2) The docs UI is pointing to the wrong file
Your docs frontend may be loading a different OpenAPI file than the one you edited.
Check:
- The
url/urlssetting in Swagger UI / Redoc - That the served file path matches the updated file
- That you’re editing the correct environment’s config
3) The server is not reloading the file
If your docs are generated from a file on startup, the application may need a restart to pick up changes.
Try:
- Restart the API server
- Rebuild the app/container
- If in Docker, make sure the file is mounted correctly and not baked into the image
4) You’re editing the source, but docs are generated from build output
Some setups generate OpenAPI from code or copy the spec into a build folder.
Check:
- Whether the served spec comes from
dist/,build/, or another generated directory - Whether a build step is needed after editing the source spec
5) The OpenAPI file has invalid syntax
If the file is malformed, some tooling silently falls back to the previous version or fails to reload.
Validate it with:
- Swagger Editor
openapi-spec-validatorswagger-cli validate
6) File watching isn’t enabled
In development, the docs server may not automatically reload when the file changes.
Try:
- Enable watch/reload mode in your tool
- Restart the docs server manually after changes
If you want, I can help you debug it step by step.
Tell me:
- what stack you’re using (Swagger UI, Redoc, FastAPI, NestJS, Spring, Express, etc.)
- how the OpenAPI file is served
- whether this happens locally or in production