nestjs / swagger

OpenAPI (Swagger) module for Nest framework (node.js) :earth_americas:

Home Page:https://nestjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ApiHeader overwrites schema type

fermentfan opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

The API header options type tells me there is a $schema.type option that I can pass OpenAPI Data types to. Sadly it overwrites the type always with string. It doesn't seem like this is needed and just limits us from using accurate types here?

Code where it happens:
https://github.com/nestjs/swagger/blob/2d999bd8940e6254755d9c5e7665b773bfb475aa/lib/decorators/api-header.decorator.ts#L30C1-L30C23

Minimum reproduction code

https://github.com/nestjs/swagger

Steps to reproduce

No response

Expected behavior

I'd expect it to respect the user given type when building the OpenAPI yaml.

Package version

7.1.15

NestJS version

10.2.1

Node.js version

9.8.1

In which operating systems have you tested?

  • macOS
  • Windows
  • Linux

Other

Please allow me to submit more simple bug reports

Let's track this here #2774