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

[Bug]: Parameter with - produces invalid uri template #6191

Open
4 tasks done
timotheeguerin opened this issue Feb 27, 2025 · 1 comment
Open
4 tasks done

[Bug]: Parameter with - produces invalid uri template #6191

timotheeguerin opened this issue Feb 27, 2025 · 1 comment
Labels
bug Something isn't working lib:http triaged:core
Milestone

Comments

@timotheeguerin
Copy link
Member

Describe the bug

op test(@query("foo-bar") fooBar: string): void;

Produce the following uri template which is invalid (cannot have - in variable names)
https://adidas.gitbook.io/api-guidelines/rest-api-guidelines/evolution/naming-conventions#uri-template-variables

/{?foo-bar}

it should be

/{?foo%2Dbar}

in the same way we encode $. Hyphen is special as it is not encoded by encodeUriComponent so we need to do some additional replacing

Reproduction

Playground

Checklist

@timotheeguerin timotheeguerin added the bug Something isn't working label Feb 27, 2025
@markcowl markcowl added this to the [2025] April milestone Mar 3, 2025
@markcowl
Copy link
Contributor

markcowl commented Mar 3, 2025

priority: 2

@markcowl markcowl added needs-area triaged:core compiler:core Issues for @typespec/compiler and removed compiler:core Issues for @typespec/compiler needs-area labels Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lib:http triaged:core
Projects
None yet
Development

No branches or pull requests

2 participants