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
I know could keep the variable up to date as I call on model functions, but I think it would be beneficial to be able to serialize dynamically, and less remembering!
If the above is a language limitation, maybe an interface would be useful?
The before() function is called just before serialising each property.
(The only issue I can think of is the function naming. If someone added a function before() even if they didn't implement, the serializer would be called, as typescript isn't able to check if an instance inherits after compiling, so it's really just checking if the function exists, and calling)
Probably a feature request as I can't find any examples
Would it be possible to serialize a function or typescript get function with
@JsonProperty()
?Example:
I know could keep the variable up to date as I call on model functions, but I think it would be beneficial to be able to serialize dynamically, and less remembering!
If the above is a language limitation, maybe an interface would be useful?
The before() function is called just before serialising each property.
(The only issue I can think of is the function naming. If someone added a function
before()
even if they didn't implement, the serializer would be called, as typescript isn't able to check if an instance inherits after compiling, so it's really just checking if the function exists, and calling)I've got the above example working in my fork ahaverty@7282f2c
What do ye think?
The text was updated successfully, but these errors were encountered: