Skip to content

Commit b531b7a

Browse files
committed
fixed bug in member mapping output
1 parent f27ed58 commit b531b7a

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/json_to_cpp.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,13 +345,13 @@ namespace daw::json_to_cpp {
345345
using daw::json::json_value_t;
346346
config.cpp_file( ) << fmt::format( "namespace daw::json {{\n",
347347
cur_obj.object_name );
348+
config.cpp_file( ) << fmt::format(
349+
"\ttemplate<>\n\tstruct json_data_contract<{}> {{\n",
350+
cur_obj.object_name );
348351
for( auto const &child : *cur_obj.children ) {
349352
if( config.hide_null_only and is_null( child.second ) ) {
350353
continue;
351354
}
352-
config.cpp_file( ) << fmt::format(
353-
"\ttemplate<>\n\tstruct json_data_contract<{}> {{\n",
354-
cur_obj.object_name );
355355
config.cpp_file( ) << fmt::format(
356356
"\t\tstatic constexpr char const mem_{}[] = \"", child.first );
357357
auto child_name =
@@ -389,8 +389,8 @@ namespace daw::json_to_cpp {
389389
}
390390
config.cpp_file( ) << "\t>;\n\n";
391391

392-
config.cpp_file( ) << "\t\tstatic inline auto to_json_data( " << cur_obj.object_name
393-
<< " const & value ) {\n";
392+
config.cpp_file( ) << "\t\tstatic inline auto to_json_data( "
393+
<< cur_obj.object_name << " const & value ) {\n";
394394
config.cpp_file( ) << "\t\t\treturn std::forward_as_tuple( ";
395395
is_first = true;
396396
for( auto const &child : *cur_obj.children ) {

0 commit comments

Comments
 (0)