softwaregroup-bg/ut-port-swagger

Need support for nullable types

Closed this issue · 1 comments

Sometimes, you need a property to be of certain type, but also nullable.
In OpenAPI 3.0 this is supported out of the box:

nullable: true

but not in OpenAPI 2.0, which we currently rely on.

Until recently, it was possible to use a "hack" for this, by setting:

"type": ["string", "null"]

However, this has stopped working with a recent dependency bump.
Is it possible to add support for nullable types? For example, such properties can be marked with

"x-nullable": true

Thanks.

x-nullable keyword has been implemented in "ut-swagger2-validator". PR: softwaregroup-bg/ut-swagger2-validator#2