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] inconsistent status code in some generated operations #5438

Open
ArcturusZhang opened this issue Dec 25, 2024 · 1 comment

Comments

@ArcturusZhang
Copy link
Member

when we have this spec:

@delete op delete(
    @path id: TodoItem.id,
  ): WithStandardErrors<NoContentResponse | NotFoundErrorResponse>;

this code was generated:

        [HttpDelete]
        [Route("/items/{id}")]
        [ProducesResponseType((int)HttpStatusCode.NoContent, Type = typeof(void))]
        public virtual async Task<IActionResult> Delete(long id)
        {
            await TodoItemsOperationsImpl.DeleteAsync(id);
            return Ok();
        }

This operation (when succeeded) should always produce 204, but we are returning Ok() which represents to 200.

@ArcturusZhang ArcturusZhang added the emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp label Dec 25, 2024
@lirenhe lirenhe added emitter:service:csharp and removed emitter:client:csharp Issue for the C# client emitter: @typespec/http-client-csharp labels Dec 26, 2024
@lirenhe
Copy link
Member

lirenhe commented Dec 26, 2024

Update the label as this is a server gen issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants