jsonschema2pojo
jsonschema2pojo copied to clipboard
Feature - Support for Java17 record syntax
It would be nice if the GenerationConfig could support the output as "Record" instead of old school Pojo
public record DataRecord(List<String> types, String test) { }
Thanks for the project!
There are several things that would have to be solved first:
- migrating code & build pipeline to Java 17, so that tests requiring compilation of generated code would work
- fork/extend/replace
codemodel
to support(ing)record
s
It would have to be noted that there will be limitations due to "nature" of records eg.:
- https://github.com/joelittlejohn/jsonschema2pojo/wiki/Reference#extends
- enum's defined within record
- ...
This would be an awesome addition! Another solution would be to generate interfaces using immutables.org library.
Any plans to support this ?
Is there a code generator that supports this syntax that anyone knows about? I agree this would be an excellent feature.
Looking for this also - but already making gains with your project, so thank you :)
Java 21 has increased the the applications of records and would make this feature even better