You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
For some cases, e.g. error-as-data scenarios, you need to use a root interface to provide a structure for the errors. However, having getter-only interfaces makes creating code for them very hard, since it forces immutability even when it's counter-productive (i.e. error message construction).
Describe the solution you'd like
FTL templates for interface extended with setter generation, and config option added to allow enabling that.
Describe alternatives you've considered
There really aren't any; because the implementations are also autogenerated, there is no easy way to inject the setter interface part. The only way to have this done is manually writing the setters and manually creating a composite interface to be used in place of the autogenerated one, plus custom customTypesMapping to handle it.
It's also possible to supply the templates through customTemplates, but that requires copy-pasting an implementation-specific code (templates) and maintaining them later on.
The text was updated successfully, but these errors were encountered:
@kobylynskyi what's your take on this? Do you think this would be reasonable? I could really use this option, and I can provide a PR with a simple implementation for it if you say it's OK for you - I can start working on this immediately because we have code freezes in December in my company, so I'll have spare time in the coming weeks and I could really use this modification, even if it seems small (it's a lot of custom boilerplate have to manage in our codebase due to it ATM).
Is your feature request related to a problem? Please describe.
For some cases, e.g. error-as-data scenarios, you need to use a root interface to provide a structure for the errors. However, having getter-only interfaces makes creating code for them very hard, since it forces immutability even when it's counter-productive (i.e. error message construction).
Describe the solution you'd like
FTL templates for interface extended with setter generation, and config option added to allow enabling that.
Describe alternatives you've considered
There really aren't any; because the implementations are also autogenerated, there is no easy way to inject the setter interface part. The only way to have this done is manually writing the setters and manually creating a composite interface to be used in place of the autogenerated one, plus custom
customTypesMapping
to handle it.It's also possible to supply the templates through
customTemplates
, but that requires copy-pasting an implementation-specific code (templates) and maintaining them later on.The text was updated successfully, but these errors were encountered: