JsonToKotlinClass icon indicating copy to clipboard operation
JsonToKotlinClass copied to clipboard

JsonToKotlinClass maven/gradle plugin

Open kezhenxu94 opened this issue 6 years ago • 14 comments

Now we generate the Kotlin data class and put it into the codebase, other code generator (like Protobuf and greendao) usually generate the code into a seperated folder (target/generated-sources) automatically, this would be really helpful when the JSON structure changes frequently, it won't pollute the commits history

image

kezhenxu94 avatar Apr 17 '19 05:04 kezhenxu94

@wuseal any updates ? This would be lovely to see such kotlin plugin. Check java plugin for example: https://github.com/joelittlejohn/jsonschema2pojo/tree/master/jsonschema2pojo-gradle-plugin

AlexTrotsenko avatar May 26 '20 07:05 AlexTrotsenko

Wow.. cool. @wuseal I'd vote for this feature :+1:

theapache64 avatar May 26 '20 08:05 theapache64

I'd vote for this feature 👍

hannesa2 avatar Aug 12 '20 10:08 hannesa2

Would be a great addition! 👍

kassim avatar Jan 25 '21 12:01 kassim

It would be a great addition!

eirnym avatar Feb 06 '21 18:02 eirnym

@wuseal I can write a plugin for you if you need it, it'd be a simple one :)

Here you can see mine for jsonschema2pojo https://github.com/eirnym/js2p-gradle

eirnym avatar Feb 06 '21 18:02 eirnym

@eirnym That'd be cool. You can use our library. What do you think @wuseal ?

theapache64 avatar Feb 06 '21 19:02 theapache64

Cool, @theapache64 I'd create one, how you'd like to name it?

eirnym avatar Feb 06 '21 19:02 eirnym

@wuseal makes the final call. let's wait for him. meantime, can you hop into our slack channel? Here's the invite link

theapache64 avatar Feb 06 '21 19:02 theapache64

As a plugin, I think we should create another repo to host it. Also, I recommend to create an organization and host these repos there for better collaboration and user recognition.

kezhenxu94 avatar Feb 07 '21 00:02 kezhenxu94

@kezhenxu94 I agree

theapache64 avatar Feb 07 '21 05:02 theapache64

I agree https://github.com/eirnym/js2p-gradle/issues/8#issuecomment-774426610

hannesa2 avatar Feb 07 '21 06:02 hannesa2

@eirnym Of course, That's awesome, then name can be jsontokotlinclass and id could be wu.seal.jsontokotlin or jsontokotlinclass(if no other taken up it). You could create a dir named plugin in the root repo. Welcome to open a PR here, and I and @kezhenxu94 will review it

wuseal avatar Feb 10 '21 07:02 wuseal

Is there any update on this? sounds like exactly what I need, but I cannot find such a gradle plugin so far 🤔

huehnerlady avatar May 14 '21 09:05 huehnerlady