简体   繁体   中英

Easy way to convert complex json to simple POJO files for Android

I'm trying to convert complex json response to simple POJO objects. What I mean, I can convert this json response to pojo with www.jsonschema2pojo.org , but it generates me 47 files. I don't want this solution.

I want simple and light POJO objects. So, what I need, a few pojo files (May be max 5-6 files) with entire json attributes.

Example

My sample json response ( Wordpress ): https://pastebin.ca/3855759

And the generator creates these files: see image

I read these and similar posts but I could't fix my issue;

stackoverflow.com/questions/41692991/convert-nested-json-to-simple-json stackoverflow.com/questions/31117784/convert-complex-json-to-one-level-pojo-using-jackson

So, do you have any solution to accomplish this?

try GSOnFormat plugin from in android studio plugins. you can install it from file >Settings>plugins>browse repository>GSONFORMAT

use it using alt+insert

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM