Schema::getDefault() today returns a null value if no default value is specified in the OpenAPI document. The OpenAPI standard allows to explicitly specify null when a property is nullable. However this case cannot be detected because Schema:getDefault() will return null in that situation, too. An additional boolean flag Schema::hasDefaultValue() would be required.
Use case is the OpenAPI generator, where I would like to generate special code if the default value is set explicitly to null.
Schema::getDefault()
today returns anull
value if no default value is specified in the OpenAPI document. The OpenAPI standard allows to explicitly specifynull
when a property is nullable. However this case cannot be detected becauseSchema:getDefault()
will returnnull
in that situation, too. An additional boolean flagSchema::hasDefaultValue()
would be required.Use case is the OpenAPI generator, where I would like to generate special code if the default value is set explicitly to null.