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
Feature request
Make implementing preSnapshot and postSnapshot implementable by middleware.
Is your feature request related to a problem? Please describe.
I have some models that describe user files. In order to serialize this data I need to access some global state that I might want to redefine depending on the environment. (E.x., A database interface, a file interface). In order to do this now I would have to set up a complicated set of model builders that take my interface as arguments and build the models.
Sometimes I would like to serialize/deserialize a node based on information in the parent.
It would be nice to be able to globally change how serialization is handled for other reasons. For example, I have a lot of models that are optional and those are automatically serialized as null when empty instead of just being omitted. With a middleware I could globally change that behavior without having to add processors to every model or request the change in MST.
Hey @nspaeth - I am sorry it took so long for us to get back to you here.
I think this is a good idea, although I'm not exactly sure where it'll land on the roadmap. I am going to mark this issue as PR welcome, but if you've moved on from the thought, I totally understand. It's been almost eighteen months!
Let me know if you're interested in putting something like this together. If not, I'll leave it open for future contributors who have similar needs and want a starting point.
^ Sorry, that's my bad for miscommunicating. This issue is actually an mst feature, so we will not be moving it. Closing over there, leaving open here.
Feature request
Make implementing
preSnapshot
andpostSnapshot
implementable by middleware.Is your feature request related to a problem? Please describe.
optional
and those are automatically serialized asnull
when empty instead of just being omitted. With a middleware I could globally change that behavior without having to add processors to every model or request the change in MST.See also: #662
Describe the solution you'd like
Currently, middleware does not get the
preSnapshot
orpostSnapshot
actions.Describe alternatives you've considered
Are you willing to (attempt) a PR?
The text was updated successfully, but these errors were encountered: