openapi does not display nullable schemas
See original GitHub issueBug Report
Current behavior
When using the openapi feature i noticed, that some of my nested DTOs are not correctly shown when it is nullable:
when removing nullable: true
- the DTO is displayed correctly.
Input Code
@ApiProperty({ type: LogisticsPartnerDTO, nullable: true })
customer!: Nullable<LogisticsPartnerWithLocationRes>;
Expected behavior
I would expect, that the type is shown in the Swagger Docs even though it is nullable.
Environment
"@nestjs/common": "7.6.12",
"@nestjs/core": "7.6.12",
"@nestjs/swagger": "^4.7.13",
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:10 (4 by maintainers)
Top Results From Across the Web
c# - Nullable property is not presented in the Swashbuckle ...
c# - Nullable property is not presented in the Swashbuckle. AspNetCore openapi schema properly - Stack Overflow. Stack Overflow for Teams – ...
Read more >How to specify a property can be null or a reference
This is a real-world problem for my project: complex objects reference other objects, but in some cases, the referenced object is NULL, i.e,...
Read more >Handling the null type in JSON schema - IBM
Handling the null type in JSON schema. Swagger 2.0 does not support the null type because Swagger supports only a subset of JSON...
Read more >Supported JSON Schema Keywords - Swagger
type – the value must be a single type and not an array of types. null is not supported as a type, use...
Read more >Schema generation rules · GitBook - Goswagger.Io
In JSONSchema, but not in Swagger 2.0: anyOf , oneOf and not constructs are not supported (this is for OpenAPI 3); the null...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
We’ll bump as soon as the underlying packages (https://www.npmjs.com/package/swagger-ui-dist or
fastify-swagger
) support it as well!Hi @kamilmysliwiec , is there any plan to bump this package to OAS 3.1?