Closed satano closed 4 months ago
Thanks for opening this pull request! If you have implemented new functions, write about them in the readme file.
The recent changes improve the SwaggerService
and SwaggerServiceDiscoveryProvider
classes within the MMLib.SwaggerForOcelot project. These modifications enable the default path to the downstream Swagger JSON to respect the configured API version dynamically when it is not explicitly set. A new test method ensures this behavior is validated correctly.
File | Change Summary |
---|---|
src/MMLib.SwaggerForOcelot/ServiceDiscovery/SwaggerService.cs |
Modified Path property to no longer have a default value. |
src/MMLib.SwaggerForOcelot/ServiceDiscovery/SwaggerServiceDiscoveryProvider.cs |
Refactored imports and adjusted URI building logic to handle dynamic endpoint paths and versions. |
tests/MMLib.SwaggerForOcelot.Tests/ServiceDiscovery/SwaggerServiceDiscoveryProviderShould.cs |
Added a new test method RespectApiVersionWhenUriIsNotExplicitlySet to check dynamic Swagger URI generation based on version. |
Objective (Issue #300) | Addressed | Explanation |
---|---|---|
Ensure default path for Swagger JSON respects configured version | ✅ | |
Add test method to validate behavior | ✅ |
In lines of code, our tale is spun,
Where paths and versions dance as one.
The Swagger routes now change their tune,
Reflecting APIs beneath the moon.
A test to guard this newfound grace,
Ensuring all is in its place.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Fixes #300
Summary by CodeRabbit
Refactor
Tests