Similarly, swift-openapi-generator explicitly does not "support" type: 'null'. As part of searching for something to address https://github.com/apple/swift-openapi-generator/issues/513 I have added such support for explicit nulls. This gives one more sort of input schema where swift-openapi-generator produces some useful output instead of skipping a schema.
Modifications
Bumped minimum supported Yams version.
Returntrue from isSchemaSupported for type: 'null' schemas.
Defined .null to have a builtint ype of OpenAPIValueContainer
Result
Nothing should change for existing users because type: null schemas were previously unsupported. Going forward, usages of these schemas is supported.
Based on the discussion in the other thread, I think we should not merge this PR, and instead we should simply filter out null from anyOf/allOf schemas, as OpenAPIKit will already represent the nullability on the parent schema.
Motivation
OpenAPIKit's handling of
type: 'null'
was problematic with older Yams versions. See https://github.com/mattpolzin/OpenAPIKit/pull/366/files for a test demonstrating that & dependency version bump.Similarly, swift-openapi-generator explicitly does not "support"
type: 'null'
. As part of searching for something to address https://github.com/apple/swift-openapi-generator/issues/513 I have added such support for explicit nulls. This gives one more sort of input schema where swift-openapi-generator produces some useful output instead of skipping a schema.Modifications
true
fromisSchemaSupported
fortype: 'null'
schemas..null
to have a builtint ype ofOpenAPIValueContainer
Result
Nothing should change for existing users because
type: null
schemas were previously unsupported. Going forward, usages of these schemas is supported.Test Plan
New test included.