-
Notifications
You must be signed in to change notification settings - Fork 705
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
[Versioned Clients][API Notifications] Fails to read new versions when available #1070
Comments
I see what happened. I'll consider this a bug. Honestly, this feels like a bug in The
or collapsed into a single header:
provided there is no change in meaning. If the headers are listed multiple times, then
There are various reasons why the server might do that. In reviewing the tests, I don't have any scenarios that cover these cases. The solution is pretty straight forward. I'll work on getting a fix out. Thanks for reporting it and providing a comprehensive repro. It's very helpful. |
Glad I could help identify the issue. As you mentioned, the current implementation of the Thanks again for acknowledging the report! |
Is there an existing issue for this?
Describe the bug
As described in API Notifications section, the default
ApiVersionHandlerLogger<ApiVersionHandler>
is expected to log an Information message when a new version is available; however, theApiVersionParser
fails to parse theapi-supported-versions
header's comma separated values generated by the DefaultApiVersionReporter and as a result no new version will be reported.The problem here is that the client side's ApiVersionEnumerator expects the version values to be in multiple header keys (
Headers: .... [api-supported-versions, 0.9], [api-supported-versions, 1.0] ...
) whereas the header, generated through DefaultApiVersionReporter in the server application, contains all supported versions in a single header (Headers: .... [api-supported-versions, 0.9, 1.0] ...
).The following is a sample response generated for a GET request:
Expected Behavior
New version details should be notified by default through the logger when available.
Steps To Reproduce
Sample Repo to reproduce the issue: https://github.com/chamweer/api-version-notification-bug
This repository contains 3 versioned endpoints representing 3 different use cases:
Steps to reproduce the issue:
Api.Versioning.Notification.Bug.Api
project usingdotnet run
command.Api.Versioning.Notification.Bug.Client
console app and monitor the logs to see whether you can see any information logs reporting the available versions.Exceptions (if any)
.NET Version
8.0.101
Anything else?
Asp.Versioning.Http.Client 8.0.0
Console Logs:
The text was updated successfully, but these errors were encountered: