Skip to content
This repository has been archived by the owner on Aug 28, 2021. It is now read-only.

Fix an issue with Attribute types. #97

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

logan12358
Copy link

I don't fully understand this. There doesn't seem to be a Type property on System.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.

I don't fully understand this. There doesn't seem to be a `Type` property on [`System.Attribute`](https://docs.microsoft.com/en-us/dotnet/api/system.attribute?view=netframework-4.5), 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.
@didimitrie
Copy link
Member

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants