kompendium icon indicating copy to clipboard operation
kompendium copied to clipboard

Unexpected types

Open oSumAtrIX opened this issue 1 year ago • 6 comments

My model:

image

Usage in Kompendium:

image

Result:

image

The type in question is kotlinx.datetime.LocalDateTime. The question is, why is createdAt an object?

oSumAtrIX avatar Oct 04 '24 21:10 oSumAtrIX

https://bkbn.gitbook.io/kompendium/index-1/notarized_application#custom-types

see the doc here

brizzbuzz avatar Oct 05 '24 13:10 brizzbuzz

I am aware of custom types, my question is about the default behavior

oSumAtrIX avatar Oct 05 '24 13:10 oSumAtrIX

the doc explains exactly why this is the case

brizzbuzz avatar Oct 05 '24 13:10 brizzbuzz

object representations of scalars

LocalDateTime is an object representation of a scalar value. so kompendium see that it is an object, and tries to serialize it as such.

brizzbuzz avatar Oct 05 '24 13:10 brizzbuzz

But so is a nullable of that, and yet it is serialized as a string

oSumAtrIX avatar Oct 05 '24 13:10 oSumAtrIX

oh interesting... worth looking into! It probably would have been more clear what you were saying if you had written that out instead of just screenshots lol

but thanks for explaining

brizzbuzz avatar Oct 05 '24 14:10 brizzbuzz