我有一个 avro 模式,其中我已将捕获声明为布尔值,并且我想将默认值指定为true
。
{
"namespace": "abc",
"type": "record",
"name": "Request",
"fields": [
{
"name": "amount",
"type": "long",
},
{
"name": "currency",
"type": ["string", "null"],
},
{
"name": "capture",
"type": "boolean",
"default": true
}
}
Run Code Online (Sandbox Code Playgroud)
当在 Java 中使用它时,它会获得默认值null
。我需要做什么才能将其默认为true
?