fix: null ref (#286)

This commit is contained in:
Ryan Brink
2022-08-13 11:29:35 -07:00
committed by GitHub
parent 5beeade430
commit 2007b1bb8c
6 changed files with 120 additions and 1 deletions

View File

@ -31,7 +31,13 @@ object SimpleObjectHandler {
}
}
prop.name to schema
// TODO This is kinda hacky 👀 And might break in certain edge cases?
val nullCheckSchema = when (prop.returnType.isMarkedNullable && schema !is OneOfDefinition) {
true -> OneOfDefinition(NullableDefinition(), schema)
false -> schema
}
prop.name to nullCheckSchema
}
val required = clazz.memberProperties.filterNot { prop -> prop.returnType.isMarkedNullable }