Skip to content

sgmarghade/json-to-avro-schema-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

General purpose AVRO schema generator from JSON schema. Supported data types are

  • NUMBER
  • STRING
  • ARRAY
  • OBJECT
  • NULL
  • BOOLEAN

Usage

  • git clone
  • mvn clean install

Command line usage :-

  • java -jar target/avro-schema-generator-1.0-SNAPSHOT.jar '{ "key1": 2.2, "key2": { "key3": "string" } }'

  • output :-

  • { "namespace" : "com.sgmarghade.test", "name" : "outer_record", "type" : "record", "fields" : [ { "name" : "key1", "type" : "double" }, { "name" : "key2", "type" : { "type" : "record", "name" : "key2_17", "fields" : [ { "name" : "key3", "type" : "string" } ] } } ]}

Using as library :-

  • String avroSchemaString = new AvroConverter(new ObjectMapper()).convert(jsonString);

About

This will help you to generate AVRO schema from JSON schema.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages