@@ -1122,7 +1122,7 @@ std::string Generator::getInputCppType(const InputField& field) const noexcept
11221122 return inputType.str ();
11231123}
11241124
1125- std::string Generator::getOutputCppType (const OutputField& field) const noexcept
1125+ std::string Generator::getOutputCppType (const OutputField& field, bool interfaceField ) const noexcept
11261126{
11271127 bool nonNull = true ;
11281128 size_t templateCount = 0 ;
@@ -1178,10 +1178,18 @@ std::string Generator::getOutputCppType(const OutputField& field) const noexcept
11781178 case OutputFieldType::Builtin:
11791179 case OutputFieldType::Scalar:
11801180 case OutputFieldType::Enum:
1181- case OutputFieldType::Object:
11821181 outputType << getCppType (field.type );
11831182 break ;
11841183
1184+ case OutputFieldType::Object:
1185+ if (interfaceField)
1186+ {
1187+ outputType << R"cpp( object::)cpp" ;
1188+ }
1189+
1190+ outputType << field.type ;
1191+ break ;
1192+
11851193 case OutputFieldType::Union:
11861194 case OutputFieldType::Interface:
11871195 outputType << R"cpp( service::Object)cpp" ;
@@ -1341,7 +1349,7 @@ struct )cpp" << interfaceType.type << R"cpp(
13411349)cpp" ;
13421350 for (const auto & outputField : interfaceType.fields )
13431351 {
1344- headerFile << getFieldDeclaration (outputField);
1352+ headerFile << getFieldDeclaration (outputField, true );
13451353 }
13461354 headerFile << R"cpp( };
13471355)cpp" ;
@@ -1421,7 +1429,7 @@ class )cpp" << objectType.type << R"cpp(
14211429 firstField = false ;
14221430 }
14231431
1424- headerFile << getFieldDeclaration (outputField);
1432+ headerFile << getFieldDeclaration (outputField, false );
14251433 }
14261434
14271435 headerFile << R"cpp(
@@ -1517,13 +1525,13 @@ std::string Generator::getFieldDeclaration(const InputField& inputField) const n
15171525 return output.str ();
15181526}
15191527
1520- std::string Generator::getFieldDeclaration (const OutputField& outputField) const noexcept
1528+ std::string Generator::getFieldDeclaration (const OutputField& outputField, bool interfaceField ) const noexcept
15211529{
15221530 std::ostringstream output;
15231531 std::string fieldName (outputField.name );
15241532
15251533 fieldName[0 ] = std::toupper (fieldName[0 ]);
1526- output << R"cpp( virtual std::future<)cpp" << getOutputCppType (outputField)
1534+ output << R"cpp( virtual std::future<)cpp" << getOutputCppType (outputField, interfaceField )
15271535 << R"cpp( > get)cpp" << fieldName << R"cpp( (service::FieldParams&& params)cpp" ;
15281536
15291537 for (const auto & argument : outputField.arguments )
0 commit comments