generator icon indicating copy to clipboard operation
generator copied to clipboard

Java POJO generation

Open typekpb opened this issue 4 years ago • 11 comments

I'd be interested in using the generator for generating the Java POJOs based on the payload definition in the particular messages.

typekpb avatar Nov 07 '19 09:11 typekpb

Us too! If we could have something like this in Node.js, that'd be perfect.

fmvilas avatar Nov 08 '19 19:11 fmvilas

I started a bit of work on this, might have more later this week.

nickspacek avatar Dec 02 '19 16:12 nickspacek

I wonder if it would be possible to leverage https://github.com/quicktype/quicktype for JSON Schema messages? OpenAPI has a similar need for this as well, but leveraging existing code generation for JSON Schema messages seems like it would make a lot of sense instead of rebuilding from scratch.

nickspacek avatar Dec 02 '19 19:12 nickspacek

Totally agree. Quicktype seems to be perfect but I've seen they lack a stable/public API. Also, it seems the company behind is not interested in maintaining it beyond their needs. Maybe a good chance for a fork? 🤔

fmvilas avatar Dec 02 '19 19:12 fmvilas

I threw together a prototype using a Quicktype filter that spits out Java mappings but haven't played around to see how robust the results are. I wondered about exploring the use of hooks or some other plugin-like approach to allow a project like generator-quicktype-models, but I haven't given it a lot of thought!

nickspacek avatar Dec 02 '19 22:12 nickspacek

Can you share this prototype code? I'm curious.

fmvilas avatar Dec 03 '19 15:12 fmvilas

Have a gander: nickspacek/generator@08520bc

nickspacek avatar Dec 03 '19 20:12 nickspacek

Nice! It looks easy! I see we can probably expose the parsed AsyncAPI document in the generate:after hook so you don't have to parse it again.

fmvilas avatar Dec 24 '19 11:12 fmvilas

This issue has been automatically marked as stale because it has not had recent activity :sleeping: It will be closed in 30 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation. Thank you for your contributions :heart:

github-actions[bot] avatar Mar 12 '20 00:03 github-actions[bot]

@typekpb @nickspacek @bbrenne hi folks, you might be interested in https://github.com/asyncapi/generator/issues/216. It would be awesome to hear your opinion.

derberg avatar Jun 04 '20 20:06 derberg

Folks, have a look at https://www.asyncapi.com/tools/modelina

derberg avatar Oct 05 '21 06:10 derberg

closing as modelina is doing it already https://github.com/asyncapi/modelina

derberg avatar Jul 05 '23 17:07 derberg