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

handle folders which look like elemetns but aren't #1073

Merged
merged 2 commits into from
Dec 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Elements/src/Serialization/JSON/JsonInheritanceConverter.cs
Original file line number Diff line number Diff line change
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
Loading