-
Notifications
You must be signed in to change notification settings - Fork 231
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
.NET Client Patterns: Service description for bytes upload should generate client following unbranded .NET client patterns #4909
Comments
Currently in order to generate the content type and a binary upload method that doesn't serialize a model, the tsp would need to look like this - note we add the contentType header and body decorator:
|
/cc @schaabs for thoughts on the tsp requirements mentioned in previous comment. |
Adding the context that @KrzysztofCwalina raised the concern with me directly that those decorators would need to be added to obtain a client that used the headers and didn't write those models. I am happy to defer to @schaabs and @KrzysztofCwalina regarding whether that is the TypeSpec we would like customers/partners to need to write in order to have our .NET generator write a client that can upload application/octet-stream bytes to a service. For me personally, I would wonder the following about:
|
As part of determining the tsp -> C# story, we should keep in mind what the experience would look like across other language generators. It would be odd if a single tsp generated semantically different clients across the languages that we support, which makes me wonder if these type of inferences would be better to make further upstream in TCGC so that all the language emitters get it for free. |
Content-Type is required for HTTP, so the compiler should either default what it thinks the Content-Type should be, or it should error. |
@tadelesh is this defaulted in TCGC? |
for content type, it is defaulted by typespec http library. for the another discussion about the default content type: #5408 (comment) |
TypeSpec file:
Expected client output
A diff of expected generator output compared to current generator output is here: annelo-msft#2
The text was updated successfully, but these errors were encountered: