Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Allow option objects of any Umple model to be serialized/deserialized to/from Json #1067
It would be good if any object had a
Since this would not be needed in every single model, my suggestion is to only generate this if -s Json is specified as a suboption on a generator.
A complication is that Umple has dates and times as primitives. We would need to use ISO8601 format. See https://www.hanselman.com/blog/OnTheNightmareThatIsJSONDatesPlusJSONNETAndASPNETWebAPI.aspx
Note that Umple already has a Json generator, but it is for a representation of the model, not the instances of the model. See Generator_CodeJson.ump
Also Umple has a parser for Json. See Json_Code.ump.
For serialization, associations should probably become arrays. But some mechanism for dealing with cycles would be needed.
For the deserialization, it would seem necessary to be able to call the deserialization of associated objects, and again how to deal with cycles would seem necessary.
In both the above cases, it would seem that perhaps an objectID ought to be stored in the Json, so the same object encountered twice would result in any other attributes being stored.