Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bigger aim: pluggable code generation #9

Open
judgej opened this issue Jun 11, 2019 · 0 comments
Open

Bigger aim: pluggable code generation #9

judgej opened this issue Jun 11, 2019 · 0 comments

Comments

@judgej
Copy link
Member

judgej commented Jun 11, 2019

This is a more general pain point that I would like to solve with the code generation.

Due to its history, the OpenAPI code generator is quite monolithic. It was originally developed by one organisation to run on one site to generate one small set of code examples, so was never really designed to scale much.

Now, adding a new output to the code generator involves writing code to run in the application. It needs skills in Java, a Java development environment, and it needs to be developed in conjunction with the destination code that is needed, which could be in any other language going. That is quite a barrier to entry.

It is possible to plug in a new set of output templates, not compiled into the application, at generation time, and that goes some way to tweaking generated code rules. However, a large element of generation is in the Java classes, and that is much harder to tweak and add in at run-time if Java is not what you are geared up use.

I'm not sure what the solution here is, but some thoughts:

  • Every project I've generated code for has its own specific requirements and tweaks to be made. Part of this is just a learning process to create the code that is most useful and portable between projects, but part of this is down to the project specifics. It seems that each project should be able to maintain its own set of generation rules.
  • The environment to create or extend the Java part of the generation rules should be accessible, easy to set up, straight forward to use. Would this be a container with everything in? Maybe there is one.
  • Tweaking the templates alone is certainly not enough.

I'm coming from a PHP background, but I guess it could apply to any destination library. Any thoughts and suggestions on how this could work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant