Skip to content

Instantly share code, notes, and snippets.

@mykidong
Created May 24, 2018 14:38
Show Gist options
  • Save mykidong/a158207831502a4bb0d0d90aefe73910 to your computer and use it in GitHub Desktop.
Save mykidong/a158207831502a4bb0d0d90aefe73910 to your computer and use it in GitHub Desktop.
List<String> pathList = new ArrayList<>();
pathList.add("/META-INF/avro/request-header.avsc");
pathList.add("/META-INF/avro/record-header.avsc");
pathList.add("/META-INF/avro/record.avsc");
pathList.add("/META-INF/avro/records.avsc");
pathList.add("/META-INF/avro/produce-request.avsc");
AvroSchemaLoader avroSchemaLoader = AvroSchemaLoader.singletonForSchemaPaths((String[])pathList.toArray(new String[0]));
String schemaKey = "io.shunters.coda.avro.api.ProduceRequest";
Schema schema = avroSchemaLoader.getSchema(schemaKey);
System.out.println("schema key: [" + schemaKey + "]\n" + schema.toString(true));
@mykidong
Copy link
Author

.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment