Skip to content

@head request with a body wrongly flags the content type #9832

@timotheeguerin

Description

@timotheeguerin

Release 1.9.1 of @typespec/http updated so that the content-type header present in

Playground Link

I don't know if it is valid or not to do that with HEAD but the resulting openapi seems wrong as it now include the content type as header and the response has the wrong one

import "@typespec/http";

using Http;

@head
op listHead(): OkResponse | Error;

@error
model Error {
  @header
  contentType: "application/problem+json";

  type: string;
}
          headers:
            content-type:
              required: true
              schema:
                type: string
                enum:
                  - application/problem+json
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'

Metadata

Metadata

Labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions