There're two microservices: Api Gateway (http://localhost:8080/) & User (http://localhost:8082/).
If you make a first request to swagger for User through Api Gateway: http://localhost:8080/user/ the config will be generated, but when you try to get User config from direct request to http://localhost:8082/ we can see Fail.
And also it's doesn't work vice versa:
if your first is a direct request without Api Gateway: http://localhost:8082/ then User config will be generated, but when you try to get User config through Api Gateway(http://localhost:8080/user/).
I think this can be fixed, for example, for each request we can generate configs, without caching.
But springdoc.cache.disabled doesn't help.

There is no known issues on reverse project.
You can have a look at the necessary configuration if you are using a reverse proxy in this section:
And this is the link to a sample code using spring-cloud-gateway in microservices architecture:
I had written an example of the project with the failure.
And one more, we defined that problem shows when we work with Groups. Without groups works well.
https://github.com/krummerd/openapi-issue/tree/master/openapi-gateway
The current springdoc version is 1.41
I also encountered the same problem.
I investigated and found that the problem should be
File SwaggerUiConfigProperties: line 195 caused
Steps to reproduce:
If it is accessed through the gateway for the first time, the initial urls object is /user/ v3/api-docs/api
If you access it through user service at one time, the url is /v3/api-docs/api but when you first access through the gateway, the url of the SwaggerUrl object has already been assigned.
However, due to the if (StringUtils.isBlank(elt.url)) judgment, / v3/api-docs/api did not succeed.
Conversely, if you access user service for the first time, access via the gateway will also fail
During the investigation, it was found that the oauth2RedirectUrl attribute has a similar situation
@krummerd,
Thanks to your sample code, the issue you are facing is now reproducible.
@krummerd, @oursy
A fix is now available on master, and you can already validate it with the latest snapshot.(1.4.2-SNAPSHOT)
Upgrade to 1.4.2-SNAPSHOT problem solved
But there is another problem 1.4.1 version file SwaggerUiConfigProperties.addGroup method was deleted
After some searching, addGroup was moved to the SwaggerUiConfigParameters file. It works normally after replacing the original SwaggerUiConfigProperties file.
Most helpful comment
Upgrade to 1.4.2-SNAPSHOT problem solved
But there is another problem 1.4.1 version file
SwaggerUiConfigProperties.addGroupmethod was deletedAfter some searching, addGroup was moved to the
SwaggerUiConfigParametersfile. It works normally after replacing the originalSwaggerUiConfigPropertiesfile.