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
IIUC, presently, Contraband generates the companion .apply method for all the data types. It may be useful to make it optional, and override it when needed. This is useful when you want to hide the actual constructor, and provide a smart constructor.
The text was updated successfully, but these errors were encountered:
As of 0b05c3f the constructors are already hidden, and the generated apply methods are the smart constructors.
Part of Contraband's ideology and encoding relies on owning and controlling the generated apply methods, so I fear this feature might be a bit "against the grain".
To be able to provide more useful, alternative apply methods to the ones provided to you by Contraband (and I've shared this same need) you need to either reach for extension methods or encode them as Scala embedded in JSON strings, with the necessary escaping (or double escaping) of course. I'm not sure if the Contraband Schema Language (CSL) provides an equivalent.
IIUC, presently, Contraband generates the companion
.apply
method for all the data types. It may be useful to make it optional, and override it when needed. This is useful when you want to hide the actual constructor, and provide a smart constructor.The text was updated successfully, but these errors were encountered: