Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
franzpoeschel committed Jun 26, 2024
1 parent e43369b commit b632f9f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions examples/14_toml_template.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ void write()
std::string config = R"(
{
"iteration_encoding": "variable_based",
"json": {
"dataset": {"mode": "template"},
"attribute": {"mode": "short"}
},
"toml": {
"dataset": {"mode": "template"},
"attribute": {"mode": "short"}
Expand Down
6 changes: 4 additions & 2 deletions src/IO/JSON/JSONIOHandlerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -642,14 +642,16 @@ void JSONIOHandlerImpl::createDataset(
break;
}
case IOMode::Template:
if (parameter.extent != Extent{0})
if (parameter.extent != Extent{0} &&
parameter.dtype != Datatype::UNDEFINED)
{
dset["extent"] = parameter.extent;
}
else
{
// no-op
// If extent is empty, don't bother writing it
// If extent is empty or no datatype is defined, don't bother
// writing it
}
break;
}
Expand Down

0 comments on commit b632f9f

Please sign in to comment.