https://kotlinlang.org logo
#http4k
Title
# http4k
d

dave

05/06/2022, 7:00 AM
Looks like a bug - we purposely don't allow null field values in examples as we introspect the example objects to generate the schema
a

alightgoesout

05/06/2022, 8:06 AM
In my case I cannot create a valid example without have a null field. The body is actually a list of items which reference their parent. Root items don't have parents (thus the
null
field). In my example, one of the items has the parent field set and the other has the parent field as
null
.
Is there a way for me to provide the schema instead of it being inferred from my example?
d

dave

05/06/2022, 8:11 AM
nope.
it's a limitation of the current mechanism. We check for null somewhere and throw if we can't retrieve a a field value
a

alightgoesout

05/06/2022, 8:22 AM
OK, thanks for the feedback. Unfortunately, the current behavior is blocking me.
d

dave

05/06/2022, 8:36 AM
it's possible if you replaced the usage of SimpleLookup FieldRetrieval you could unblock yourself
a

alightgoesout

05/06/2022, 8:37 AM
Ok, I'll take a look