Closed logan12358 closed 3 weeks ago
Yep, that file is a legacy from back in the days. It is magic, as it was originally autogenerated code from nswag based on the swagger specs. Of course, magic had to be tinkered with, so there is some hard-coded stuff that makes it even more brittle.
In short, it just looks for the discriminator aptly named type
(irony) and deserialises the json object into the right kind of speckle object.
I'll test with Gh and the rest as soon as i get the chance... We'll probably need to look at this closely in the near future.
I don't fully understand this. There doesn't seem to be a
Type
property onSystem.Attribute
, so I don't know why it generally works at the moment. Deserialisation didn't work on iOS when compiled through Unity's IL2CPP, but it does with this fix.I'm not set up to test this with the current Dynamo & Grasshopper builds, and that should probably happen before merging.
Generally, this file seems a bit magic & confusing. Feedback would be welcome.