module Inner = {
@schema
type t = {k: int}
}
module OuterInt = {
@schema
type t = {int?: @s.null option<int>}
}
module OuterRecord = {
@schema
type t = {record?: @s.null option<Inner.t>}
}
let int = {OuterInt.int: None}
let record = {OuterRecord.record: None}
let intJson = int->S.reverseConvertToJsonOrThrow(OuterInt.schema)->Js.Json.stringify
let recordJson = record->S.reverseConvertToJsonOrThrow(OuterRecord.schema)->Js.Json.stringify
intJson->Js.log2("Int JSON:", _)
recordJson->Js.log2("Record JSON:", _)
Expected output:
Int JSON: {"int":null}
Record JSON: {"record":null}
Actual output:
Int JSON: {"int":null}
Record JSON: {"record":{"BS_PRIVATE_NESTED_SOME_NONE":0}}