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

[BUG] Type Boolean in swagger docs is a object #2392

Closed
thanhchuongbmd opened this issue Jul 22, 2023 · 2 comments
Closed

[BUG] Type Boolean in swagger docs is a object #2392

thanhchuongbmd opened this issue Jul 22, 2023 · 2 comments

Comments

@thanhchuongbmd
Copy link

thanhchuongbmd commented Jul 22, 2023

Information

  • Version: 7.34.0
  • Packages: "@tsed/common": "7.34.0",
    "@tsed/core": "7.34.0",
    "@tsed/exceptions": "7.34.0",
    "@tsed/json-mapper": "7.34.0",
    "@tsed/platform-express": "7.34.0",
    "@tsed/socketio": "7.34.0",
    "@tsed/swagger": "7.34.0",
    "@tsed/typeorm": "7.34.0"

In a swagger doc generate boolean is a object and can not receive value this property on product. isOutStock

Example

import { Property } from "@tsed/schema";
export class Product {
    @Property()
    isOutStock: boolean;
}
Screen Shot 2023-07-22 at 11 34 32

Result on swagger

@Romakita
Copy link
Collaborator

Romakita commented Jul 22, 2023

Hello @thanhchuongbmd

Isn't possible this scenario is widely covered in unit test and integration test. And many project in production works also.
Your given example works.

Please verify your code (tsconfig, schema etc) ;), generate a small project with CLI, create a small model with a boolean props and you'll see that works as expected.

See you
Romain

@github-actions
Copy link

🎉 Are you happy?

If you appreciated the support, know that it is free and is carried out on personal time ;)

A support, even a little bit makes a difference for me and continues to bring you answers!

github opencollective

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