Skip to content

OC版Avro log 格式校验工具,目前支持所有Avro数据类型校验

License

Notifications You must be signed in to change notification settings

xuvw/MXAvroLogValidate

Repository files navigation

MXAvroLogValidate

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

MXAvroLogValidate is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'MXAvroLogValidate'

##Usage

NSArray *schemas = @[@"BaseLog",
                         @"CreateHotelOrder",
                         @"SubmitCarOrder",
                         @"CarOrder",
                         @"EventType",
                         @"SubmitHotelOrder",
                         @"Client",
                         @"HotelOrder",
                         @"UserInfo",
                         @"CreateCarOrder",
                         @"Order"];
    [MXAvroLogValidator configWithRootSchema:@"BaseLog" subSchemas:schemas];
    NSDictionary *dic = jsonObject;
    [dic validateAvroLogWith:^(BOOL validateResult, NSDictionary * _Nonnull invalidatePathDic) {
        if (!validateResult) {
            NSLog(@"校验失败:%@",invalidatePathDic);
        }else {
            NSLog(@"校验成功");
        }
    }];

Author

xuvw, [email protected]

License

MXAvroLogValidate is available under the MIT license. See the LICENSE file for more info.

About

OC版Avro log 格式校验工具,目前支持所有Avro数据类型校验

Resources

License

Stars

Watchers

Forks

Packages

No packages published