typespec icon indicating copy to clipboard operation
typespec copied to clipboard

Nullable response have a weird behavior right now

Open timotheeguerin opened this issue 2 years ago • 5 comments

import "@typespec/http";

using TypeSpec.Http;

@error
model Error {
  message: string;
}

@route("/1") op read1(): string | null;
@route("/2") op read3(): string | null | Error;

Playground link

Resulting is a 204 no content before PR #355 which remove ignore null responses.

Feel like it should be making the string body nullable

timotheeguerin avatar Mar 23 '22 00:03 timotheeguerin