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

[http-server-csharp] generator throws error when void is the return type in operation #4998

Closed
ArcturusZhang opened this issue Nov 7, 2024 · 0 comments · Fixed by #5140
Closed
Assignees
Labels

Comments

@ArcturusZhang
Copy link
Member

if I have this typespec:

    @post
    @route("/hello")
    op hello(): void;

and I run the generator, it gives me this error:

../<unknown location>:1:1 - error @typespec/http-server-csharp/invalid-intrinsic: Intrinsic type void is not valid in this context.  Please use a model, enum, union, scalar, or the unknown type

there are multiple issues in this error message.

  1. the location of the error is not clearly flagged. Lucky for me, my typespec only have one void therefore I am able to locate the issue.
  2. the reason does not make any sense because for a post, it is very common that people would use void as its response type indicating that this operation returns nothing in body.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants