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

Reduce the verbosity of generated Java/Kotlin #2409

Open
stuartwdouglas opened this issue Aug 17, 2024 · 0 comments
Open

Reduce the verbosity of generated Java/Kotlin #2409

stuartwdouglas opened this issue Aug 17, 2024 · 0 comments
Assignees
Labels
good first issue Good for newcomers jvm

Comments

@stuartwdouglas
Copy link
Contributor

There are some optimisations we could make here, a bit one would be not generating empty request / response objects, and generating methods with no parameters.

e.g. instead of generating

class EmptyVerbRequest{}
interface VerbClient {
 void call (EmptyVerbRequest req);
}

We could just generate:

interface VerbClient {
 void call ();
}

We need to make sure that adding additional optional parameters to the schema does not break compilation though, so if we are doing this optimisation we also need to allow for generating both methods if the request object only has optional params, e.g.:

class EmptyVerbRequest{ Optional<String> optinalParam;}
interface VerbClient {
 void call (EmptyVerbRequest req);
 void call();
}

This means that if the empty body is ever expanded with an optional parameter existing code will continue to work.

@github-actions github-actions bot added the triage Issue needs triaging label Aug 17, 2024
@ftl-robot ftl-robot mentioned this issue Aug 17, 2024
@stuartwdouglas stuartwdouglas removed the triage Issue needs triaging label Aug 26, 2024
@stuartwdouglas stuartwdouglas added the good first issue Good for newcomers label Sep 5, 2024
@tomdaffurn tomdaffurn self-assigned this Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers jvm
Projects
None yet
Development

No branches or pull requests

2 participants