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

Nullable not included in type definition #36

Closed
bluenote10 opened this issue Mar 25, 2020 · 3 comments
Closed

Nullable not included in type definition #36

bluenote10 opened this issue Mar 25, 2020 · 3 comments
Assignees

Comments

@bluenote10
Copy link

According to this information it should be possible to define a nullable type in OpenAPI 3.0.x like this:

schemas:
  StringNullable:
    type: string
    nullable: true

However this generates the following TypeScript:

export type StringNullable = string;

I was hoping it would create:

export type StringNullable = string | null;
@js2me js2me self-assigned this Mar 25, 2020
@js2me
Copy link
Member

js2me commented Mar 25, 2020

@bluenote10 Thanks for open this issue!
Will fix it today I guess :)

@bluenote10
Copy link
Author

Awesome, thanks!

js2me added a commit that referenced this issue Mar 25, 2020
feat: handle nullable option for primitive types (#36)

Co-authored-by: svolkov <svolkov@everpoint.ru>
@js2me js2me mentioned this issue Mar 25, 2020
js2me added a commit that referenced this issue Mar 25, 2020
* feat: handle nullable option for primitive types (#37)

feat: handle nullable option for primitive types (#36)

Co-authored-by: svolkov <svolkov@everpoint.ru>

* bump: up version to 1.6.2; chore: update swagger2openapi to latest (6.0.0); docs: update CHANGELOG

Co-authored-by: svolkov <svolkov@everpoint.ru>
@js2me
Copy link
Member

js2me commented Mar 25, 2020

Fixed in #38

@js2me js2me closed this as completed Mar 25, 2020
GraiemBell added a commit to GraiemBell/swagger-typescript-api that referenced this issue Nov 20, 2023
* feat: handle nullable option for primitive types (#37)

feat: handle nullable option for primitive types (acacode/swagger-typescript-api#36)

Co-authored-by: svolkov <svolkov@everpoint.ru>

* bump: up version to 1.6.2; chore: update swagger2openapi to latest (6.0.0); docs: update CHANGELOG

Co-authored-by: svolkov <svolkov@everpoint.ru>
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