Closed maximelkin closed 4 years ago
Unfortunately, union types are not supported and very likely won't be supported in the future. The reason is that TypeScript in certain scenarios implicitly defines such unions, for example, when your property is marked as optional and "strict"
configuration property is set to true
. Likewise, sometimes enums (it depends on some factors) are implicitly transformed into union types instead. Thus, it would be impossible for us to distinguish whether a union was generated by the compiler, or specified explicitly by the developer.
I'm submitting a...
Current behavior
When array item declared as nullable, plugin is unable to generate appropriate schema for property
Expected behavior
openapi schema should be generated with nullable items
Minimal reproduction of the problem with instructions
What is the motivation / use case for changing the behavior?
Reduce boilerplate in that cases
Environment
@nestjs/swagger: 4.5.7