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

Add Support For Uri Template Path Expansion #5561

Open
jorgerangel-msft opened this issue Jan 9, 2025 · 7 comments
Open

Add Support For Uri Template Path Expansion #5561

jorgerangel-msft opened this issue Jan 9, 2025 · 7 comments
Labels
emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp

Comments

@jorgerangel-msft
Copy link
Contributor

Follow up to #5396. Typespec added uri template support which allows for path expansion for path parameters. The emitter + MGC currently only support exploding query parameters but a design should be considered to support the same for path expansion.

Typespec ref: #3736 (comment)

@JoshLove-msft
Copy link
Contributor

This is covered by existing cadl-ranch scenarios - need to link to the existing scenarios - under Routes.

@jorgerangel-msft
Copy link
Contributor Author

@JoshLove-msft
Copy link
Contributor

There isn't BCL support for Uri Template as far as we know - #3736 (comment). We would need BCL support for this as we won't be rolling our own Uri Template parser.

@JoshLove-msft JoshLove-msft self-assigned this Jan 21, 2025
@JoshLove-msft
Copy link
Contributor

The only part that is a GA requirement is explode and allowReserved which we already support.

@JoshLove-msft JoshLove-msft removed their assignment Jan 23, 2025
@JoshLove-msft
Copy link
Contributor

Ideally, BCL would provide support for this. We should start an email thread on this topic.

@JoshLove-msft
Copy link
Contributor

The plan is that this should be supported in TCGC so that languages can avoid taking runtime dependencies on uri template libraries and so that the logic is consistent across languages. TCGC would need to parse the URI template into an AST that is passed back to all of the emitters.

@JoshLove-msft
Copy link
Contributor

Basic parameter replacement can be supported in the meantime, e.g.

@server(    
  "https://{region}.codesigning.azure.net/",    
  "Sign and retrieve relevant information pertaining signing process.",    
  {    
    @doc("The Azure region wherein requests for signing will be sent.")    
    region: string,    
  }

should be able to be generated. Currently this crashes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp
Projects
None yet
Development

No branches or pull requests

2 participants