Skip to content

Latest commit

 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

Stars

2 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages