Refactor JSON Marshalers in Bootsrap.groovy #4427
drodzewicz
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The discussion about JSON Marshalers was quite a while ago but after taking a look at them in the
Boostrap.groovy
I remembered one thing and wanted to bring it up.If I remember correctly, we decided that we wanted to define the JSON structure we return in a class method
toJson()
and call the it in theBootsrap.groovy
file to register it as an object marshaler likeand then in
Bootsrap.groovy
register it likeSo I was wondering if we are going to proceed with that convention or are we going to go some other route.
If we are sticking with it I suggest creating a simple ticket where we clean up the
Bootstrap.groovy
file by transferring all of the defined Marshalers toDomain > Map toJson()
.Another idea/suggestion would be to not define the marshalers manually since the code is repetitive and instead do something like:
This is sudocode and I am not sure this would work, but just wanted to throw this idea out.
Beta Was this translation helpful? Give feedback.
All reactions