我想在Apache Avro中制作一个简单API的模式,但问题是我的API有标题字段"内容类型"和Avro不允许" - "在名字中。 这是我的JSON:
"headers": {"Content-Type": "application/x-www-form-urlencoded"}
这是架构示例:
{
"name": "headers",
"type": {
"type": "record",
"name": "headers",
"fields": [
{ "name": "Content-type", "type": ["string", "null"] }
]
}
},
答案 0 :(得分:0)
使用Avro map代替记录代表标题:
{
"name": "headers",
"type": {
"type": "map",
"values": "string"
}
},