Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serialiser_Engine: GenericTypeDefinition classes don't deserialise properly if different parameters present #1737

Closed
adecler opened this issue May 5, 2020 · 0 comments · Fixed by #1756
Assignees
Labels
type:bug Error or unexpected behaviour

Comments

@adecler
Copy link
Member

adecler commented May 5, 2020

Description:

Take for example the case of public class Tree<T> in BH.oM.Data.Collections

The problem for Tree is that the type is simply stored as Tree'1 without containing the Generic types. This is because the class itself is a GenericTypeDefinition (i.e. uses <T> in the class definition). So trees are deserialisiing properly as long as there is only one type of tree being deserialise. As soon as there is more than one, FromJson fails:

image

Here's another example easier to reproduce:

image

If I would rerun the FromJson of the LibraryTree, it would then give me a CustomObject

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Error or unexpected behaviour
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant