Skip to content
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

Support AllowReserved in Path Implementation #4966

Closed
Tracked by #1318
lmazuel opened this issue Aug 7, 2024 · 1 comment · Fixed by microsoft/typespec#4294 or #5031
Closed
Tracked by #1318

Support AllowReserved in Path Implementation #4966

lmazuel opened this issue Aug 7, 2024 · 1 comment · Fixed by microsoft/typespec#4294 or #5031
Assignees
Labels
DPG/RLC v2.1 Post Gallium work DPG

Comments

@lmazuel
Copy link
Member

lmazuel commented Aug 7, 2024

No description provided.

@pshao25
Copy link
Member

pshao25 commented Aug 8, 2024

For this case:

model PathModel {
  @path(#{ allowReserved: true }) path1: string;
  @path(#{ allowReserved: true }) path2: string;
}

interface WidgetService {
  @route("/here") op c1(...PathModel): void;
}

Current:

internal HttpMessage CreateTestRequest(string path1, string path2, RequestContext context)
{
    ...
    uri.Reset(_endpoint);
    uri.AppendPath("/here/", false);
    uri.AppendPath(path1, true); <= encode true
    uri.AppendPath("/", false);
    uri.AppendPath(path2, true);
    ...
}

Change to

internal HttpMessage CreateTestRequest(string path1, string path2, RequestContext context)
{
    ...
    uri.Reset(_endpoint);
    uri.AppendPath("/here/", false);
    uri.AppendPath(path1, false); <= encode false
    uri.AppendPath("/", false);
    uri.AppendPath(path2, false);
    ...
}

@pshao25 pshao25 self-assigned this Aug 8, 2024
@chunyu3 chunyu3 added DPG DPG/RLC v2.1 Post Gallium work labels Aug 13, 2024
github-merge-queue bot pushed a commit to microsoft/typespec that referenced this issue Sep 3, 2024
Fix Azure/autorest.csharp#4966

---------

Co-authored-by: Pan Shao <pashao@microsoft.com>
sarangan12 pushed a commit to sarangan12/typespec that referenced this issue Sep 16, 2024
Fix Azure/autorest.csharp#4966

---------

Co-authored-by: Pan Shao <pashao@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DPG/RLC v2.1 Post Gallium work DPG
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants