[Bug]: path template parameter is not populated
igor-tatarnikov-idt opened this issue · 1 comments
Describe the bug
Original bug created in Swagger UI - swagger-api/swagger-ui#10078
Having an /api/hello/name={name}
API method declared, I see Swagger UI with required name
input. But the actual value I specify is not replaced in the path template and API receives "name" parameter with "{name}" value.
Expected behavior
Path template parameters get populated
Actual behavior
Path template parameters are not populated
Steps to reproduce
Exception(s) (if any)
No response
Swashbuckle.AspNetCore version
v6.6.1+
.NET Version
8
Anything else?
I can see that v6.6.1 originally referenced Swagger UI 5.17.1 - based on this PR. The later version bumps were made by dependabot - https://github.com/martincostello/Swashbuckle.AspNetCore/commits/master/src/Swashbuckle.AspNetCore.SwaggerUI/package.json
Does it make sense to freeze Swagger UI version at the v5.17.6 which seems to be the latest reliable until Swagger UI issue is fixed? - Details - swagger-api/swagger-ui#10078
Does it make sense to freeze Swagger UI version at the v5.17.6 which seems to be the latest reliable until Swagger UI issue is fixed?
Swagger UI is on the balance of probability always going to have some issue or another, with varying numbers of people affected. We can't freeze swagger-ui indefinitely waiting for a "perfect" release, and we don't have the resources to test every single use case of a third-party library to ensure that after we unfreeze it won't don't pick up any new future issues.
Given that there's been 7 patch releases since it was broken and this hasn't been spotted yet, that suggests to me that it's not a core use case that's broken, but a minority one. I for one didn't even know this functionality existed in the first place 😄
The onus is on swagger-ui to catch bugs and not ship them in the first place - we can't re-validate everything again here.
Regarding the specific issue, I've subscribed to the issue and will watch for a new release being fixed so that we ingest it as soon after.
In the mean time if your specific use case is broken, I suggest that you temporarily override the version of swagger-ui used in your app to the previous version by adding a copy of the previous swagger-ui release using static assets in your wwwroot folder with the same path as the request come from - this should cause the embedded resources to be bypassed and served from static content instead.