What is the recommended way to generate OpenAPI spec?

If I have an API protected by jwt auth using istio then my API doc no longer has a convenient way to generate the Open API spec without repeating all the functionalities.

All the api frameworks, e.g. FastAPI, Symforny etc supports auto generation of api docs based on the annotations.

Anyone has overcome this issue when using istio authorization?