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

Depict null values in array type ECProperty output #806

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
15 changes: 13 additions & 2 deletions iModelCore/ECDb/ECDb/ECSql/JsonECSqlSelectAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,10 +502,14 @@ BentleyStatus AdapterHelper::PrimitiveArrayToJson(BeJsValue jsonValue, IECSqlVal
jsonValue.SetEmptyArray();
for (IECSqlValue const& arrayElementValue : ecsqlValue.GetArrayIterable())
{
BeJsValue arrayElementJsonValue = jsonValue.appendValue();
if (arrayElementValue.IsNull())
{
arrayElementJsonValue.SetNull();
continue;
}

if (SUCCESS != PrimitiveToJson(jsonValue.appendValue(), arrayElementValue, arrayElementType, formatOptions, abbreviateBlobs))
if (SUCCESS != PrimitiveToJson(arrayElementJsonValue, arrayElementValue, arrayElementType, formatOptions, abbreviateBlobs))
return ERROR;
}

Expand All @@ -520,7 +524,14 @@ BentleyStatus AdapterHelper::StructArrayToJson(BeJsValue jsonValue, IECSqlValue
jsonValue.SetEmptyArray();
for (IECSqlValue const& arrayElementValue : ecsqlValue.GetArrayIterable())
{
if (SUCCESS != StructToJson(jsonValue.appendValue(), arrayElementValue, schemaManager, formatOptions))
BeJsValue arrayElementJsonValue = jsonValue.appendValue();
if (arrayElementValue.IsNull())
{
arrayElementJsonValue.SetNull();
continue;
}

if (SUCCESS != StructToJson(arrayElementJsonValue, arrayElementValue, schemaManager, formatOptions))
return ERROR;
}

Expand Down
Loading