Skip to content

Implement IParsable on Uri - #134112

Merged
MihaZupan merged 1 commit into
dotnet:mainfrom
MihaZupan:mizupan-microsoft-uri-iparsable
Sep 17, 2026
Merged

MihaZupan merged 1 commit into
dotnet:mainfrom
MihaZupan:mizupan-microsoft-uri-iparsable

Conversation

@MihaZupan

Copy link
Copy Markdown
Member

Closes #92285

As discussed on the API review issue, the methods are implemented explicitly, and the behavior is UriKind.RelativeOrAbsolute with AllowImplicitFilePaths = false.

@MihaZupan MihaZupan added this to the 12.0.0 milestone Sep 16, 2026
@MihaZupan MihaZupan self-assigned this Sep 16, 2026
Copilot AI lite review requested due to automatic review settings September 16, 2026 22:59
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).
13 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @karelz, @dotnet/ncl
See info in area-owners.md if you want to be subscribed.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved blocking issues were identified.

Pull request overview

Adds explicit IParsable<Uri> support using relative-or-absolute parsing with implicit file paths disabled.

Changes:

  • Updates the public API and Uri implementation.
  • Adjusts parsing invariants.
  • Adds parsing and file-path behavior tests.
File summaries
File Description
src/libraries/System.Runtime/ref/System.Runtime.cs Adds the IParsable<Uri> API contract.
src/libraries/System.Private.Uri/tests/FunctionalTests/UriCreationOptionsTest.cs Tests file-path behavior.
src/libraries/System.Private.Uri/tests/FunctionalTests/UriCreateStringTests.cs Tests parsing scenarios and edge cases.
src/libraries/System.Private.Uri/src/System/UriExt.cs Implements parsing behavior and updates invariants.
src/libraries/System.Private.Uri/src/System/Uri.cs Declares Uri as implementing IParsable<Uri>.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 0
  • Review effort level: Lite

@MihaZupan
MihaZupan enabled auto-merge (squash) September 17, 2026 13:29
@MihaZupan
MihaZupan requested a review from a team September 17, 2026 13:29
@MihaZupan
MihaZupan merged commit cb21790 into dotnet:main Sep 17, 2026
91 checks passed
jtschuster pushed a commit to jtschuster/runtime that referenced this pull request Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[API Proposal]: Consider support for IParsable<Uri> on System.Uri

3 participants