-
Notifications
You must be signed in to change notification settings - Fork 0
V10.2.1/normalized semanitc versions #36
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
b59fbfc
♻️ normalize semantic api versions
aicia-bot aa71667
✅ add version normalization compatibility tests
aicia-bot bd06d38
📝 update api documentation
aicia-bot 126412b
💬 update agent instructions for version normalization
aicia-bot 50a06d6
💬 Release documentation for version 10.2.1
gimlichael 7a56097
♻️ update api version reader type and improve version normalization b…
gimlichael File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
.docfx/api/types/Codebelt.Extensions.Asp.Versioning.ApiVersionAliasParser.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| --- | ||
| uid: Codebelt.Extensions.Asp.Versioning.ApiVersionAliasParser | ||
| example: | ||
| - *content | ||
| --- | ||
| Use `ApiVersionAliasParser` when callers send short version tokens such as `1`, `1.2`, or `1.2.3` over the wire but the rest of the application works with canonical `SemanticApiVersion` instances. The static `CreateSemanticVersionAlias` factory generates the alias map for a set of semantic versions, and `Parse` resolves a request token to the canonical version while the parser falls back to `ApiVersionParser.Default` for anything outside the alias table. The example below parses `1.2` and `2.0` from request strings and returns the resolved semantic versions. | ||
|
|
||
| ```csharp | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using Asp.Versioning; | ||
| using Codebelt.Extensions.Asp.Versioning; | ||
|
|
||
| namespace Codebelt.Extensions.Asp.Versioning; | ||
|
|
||
| public class AliasAwareVersionResolver | ||
| { | ||
| public IReadOnlyList<string> ResolveShortVersionTokens() | ||
| { | ||
| var stable = new SemanticApiVersion(1, 2, 0); | ||
| var next = new SemanticApiVersion(2, 0, 0); | ||
|
|
||
| IApiVersionParser parser = ApiVersionAliasParser.CreateSemanticVersionAlias([stable, next]); | ||
|
|
||
| return new[] | ||
| { | ||
| parser.Parse("1.2").ToString(), | ||
| parser.Parse("2.0").ToString() | ||
| }; | ||
| } | ||
| } | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
.nuget/Codebelt.Extensions.Asp.Versioning/PackageReleaseNotes.txt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PreviousBehaviorisinternalbut release notes describe it as a user-facing opt-outThe
PackageReleaseNotes.txtandCHANGELOG.mdboth state "aPreviousBehaviorcompatibility flag available for opting out of the normalization," implying consumers can set it. Because the property hasinternalvisibility, code outside the assembly cannot access it, so there is no public way to disable normalization on a user-constructedRestfulApiVersionReader. Additionally, sincePreviousBehaviordefaults tofalse, anyRestfulApiVersionReaderconstructed by a caller and supplied viaRestfulApiVersioningOptions.ApiVersionReaderwill silently have normalization enabled with no escape hatch.Prompt To Fix With AI