Skip to content

Utility tools to create Apache Thrift IDL from any json file.

License

Notifications You must be signed in to change notification settings

xman1979/json2thrift

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSON Data File to Apache Thrift IDL

I wrote this handy tool to help you to move to Apache Thrift

Input is json, output is thrift IDL, eg:

test.json:

{  
    "id":1,  
    "name":"A green door",  
    "price":12.50,  
    "tags":["home","green"]  
}

After convert:

java -jar json2thrift.jar -f test.json 

you will get:

/* Automatically generated by json2Thrift tool. */  
  
structMyStruct{  
    1: optional list<string> tags,  
    2: optional i32 id,  
    3: optional double price,  
    4: optional string name,  
}

Then you can use Apache thrift compiler to generate code in different languages for data serialization/de-serialization. Especially, with https://github.com/xman1979/thrift-cpp-simplejson-plist-support you can use cpp for simple json processing.

About

Utility tools to create Apache Thrift IDL from any json file.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages