码迷,mamicode.com
首页 > 其他好文 > 详细

avdl avsc

时间:2018-03-22 17:38:48      阅读:558      评论:0      收藏:0      [点我收藏+]

标签:prot   eve   array   space   man   item   pre   nts   pos   

@namespace("com.myproject")

protocol EventsProtocol {


record Man {
        union { null, int } age;
        union { null, string } name;
    }

record Events {
        string operation;
        union { Man , null } man;
        string timestamp;
    }


}

avdl 多个协议

avsc 单个协议

{
    "namespace":"com.myProject",
    "type": "record",
    "name": "MyEvents",
    "doc": "My Events",
    "fields": [
        {
            "name": "date",
            "type": "string",
            "doc": "date for events"
        },
        {
            "name": "changes",
            "type": {
                "type": "array",
                "items": {
                    "type": "record",
                    "name": "Man",
                    "fields": [
                        { "name": "englishName", "type": "string" },
                        { "name": "age", "type": "int" }
                     ],
                     "doc": "Each man contains englishName and age"
                }
            },
            "doc": "Man change list"
        }
    ]
}

 

avdl avsc

标签:prot   eve   array   space   man   item   pre   nts   pos   

原文地址:https://www.cnblogs.com/tonggc1668/p/8624240.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!