-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
urls.primaryName is not correctly switching the selected definition in the Swagger UI in Swashbuckle.AspNetCore 6.4.0, but was working correctly in Swashbuckle.AspNetCore 6.2.3 #2516
Comments
I have confirmed that this behavior works correctly in Swashbuckle.AspNetCore version:
But does not work correctly in these versions:
|
I also do have the same issue. Also app.UseSwaggerUI(c =>
{
...
c.EnableDeepLinking();
}); For now downgraded to version 6.2.3. |
This issue seems to be because the This can either be solved by introducing a new property in Here are the docs: |
Technically, this is an upstream issue with swagger-ui because it used to honor that value in the query string but now does not. See swagger-api/swagger-ui#7835 You can apply the solution suggested there with the following line in your Swashbuckle configuration: app.UseSwaggerUI(c =>
{
...
c.ConfigObject.AdditionalItems["queryConfigEnabled"] = true
} |
@domaindrivendev Thanks for the workaround, I'll try it, but should that be on by default? Otherwise you are going to get more issues from people wondering why this isn't working. |
@domaindrivendev This workaround opens an attack vector. See GHSA-qrmm-w75w-3wpx. The issue seems to have been fixed in v4.14.1 of Swagger-UI through 8168. The latest version of Swashbuckle is using v4.14.0, so upgrading the Swagger-UI version in Swashbuckle would fix this issue. |
I have included a sample solution and detailed instructions on this github repository.
You can see from the image in that sample, the urls.primaryName does not match the definition being shown:
If this is a Swagger UI specific issue then do let me know and I will log this in the Swagger UI repository. But it does seem to be related these specific versions of Swashbucke.AspNetCore versions.
The text was updated successfully, but these errors were encountered: