Skip to content

Commit

Permalink
feat(data): Allow wrapped fields to be read as normal object with a s…
Browse files Browse the repository at this point in the history
…ingle field
  • Loading branch information
SrGesus committed Jan 4, 2025
1 parent 395ff0d commit c7a12db
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions core/src/data/des/json.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,14 +244,12 @@ bool JSONDeserializer::decompose(const Type& type, void* value)

if (trait.size() == 1)
{
// If there's a single field, read it directly.
if (!this->read(trait.begin()->type(), view.begin()->value))
// If there's a single field, attempt to read it directly.
if (this->read(trait.begin()->type(), view.begin()->value))
{
CUBOS_WARN("Couldn't deserialize wrapped field {}", trait.begin()->name());
return false;
return true;
}

return true;
}

if (!mIterator->is_object())
Expand Down

0 comments on commit c7a12db

Please sign in to comment.