jsonschema2pojo icon indicating copy to clipboard operation
jsonschema2pojo copied to clipboard

Support generating all types as inner classes of one class

Open zhouzhipeng opened this issue 5 years ago • 9 comments

Useful for generating all subtypes as inner classes in one main class. The default is one class corresponding to one subtype.

zhouzhipeng avatar Jul 19 '19 09:07 zhouzhipeng

Thanks @zhouzhipeng. A few comments on this:

  1. To be consistent with the other configuration properties of this plugin, could you call your new option useInnerClasses instead of genInnerClasses?

  2. You don't yet have any integration tests for this new feature. Every new feature needs integration tests so that we can be sure the feature is not lost in the future. Can you turn GenInnerClassExample.java into some integration tests? You should think of some different scenarios in which this will be used and write tests for these.

  3. This part:

     newType = _package.classes().next()._class(...);
    

    Could you explain how it works? _package.classes().next() will just get the first class in the package. How does this work for the very first class we generate? I wonder if this will always be a good class to use :thinking:

joelittlejohn avatar Aug 12 '19 08:08 joelittlejohn

Hey guys, is there any update on this feature please? It's something I need :)

Thanks

bradleydeutsch avatar Sep 10 '19 10:09 bradleydeutsch

I need this feature too - is there anything I can do to help get it merged in?

dougsatch avatar Nov 04 '19 10:11 dougsatch

@zhouzhipeng Thanks for the great work already, but could you please take a look at the review comments ? They seem to be rather minor and this feature would be a real plus... Would be great to integrate the change before the PR's anniversary :-)

vicnevicne avatar Jun 23 '20 22:06 vicnevicne

If anyone is keen to use this, feel free to pick up the review comments yourself and created a new branch based on the work that's already been done by @zhouzhipeng.

joelittlejohn avatar Jul 14 '20 17:07 joelittlejohn

What can we do to get this changes in? Im dependent on this change as well.

shubhamoscar avatar Dec 28 '20 22:12 shubhamoscar