Skip to content

Commit

Permalink
Merge pull request #1073 from hypar-io/handle-deserialize-folders
Browse files Browse the repository at this point in the history
handle folders which look like elemetns but aren't (#1073)
  • Loading branch information
wynged committed Dec 12, 2023
2 parents 1664079 + 6291284 commit 001c0f6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Elements/src/Serialization/JSON/JsonInheritanceConverter.cs
Expand Up @@ -353,12 +353,12 @@ private System.Type GetObjectSubtype(System.Type objectType, string discriminato

// If it's not in the type cache see if it's got a representation.
// Import it as a GeometricElement.
if (jObject.TryGetValue("Representation", out _))
if (jObject.TryGetValue("Representation", out _) && discriminator != null)
{
return typeof(GeometricElement);
}
// If nothing else has worked, see if it has an ID and treat it as a generic element
if (jObject.TryGetValue("Id", out _))
if (jObject.TryGetValue("Id", out _) && discriminator != null)
{
return typeof(Element);
}
Expand Down

0 comments on commit 001c0f6

Please sign in to comment.