Skip to content

Commit c73b05e

Browse files
committed
Minor fixes to clientgen
1 parent c8b4e37 commit c73b05e

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

include/ClientGenerator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class Generator
4141
std::string getHeaderPath() const noexcept;
4242
std::string getSourcePath() const noexcept;
4343

44-
void validateQuery() const;
44+
void validateRequest() const;
4545
std::shared_ptr<schema::Schema> buildSchema() const;
4646
void addTypesToSchema(const std::shared_ptr<schema::Schema>& schema) const;
4747

src/ClientGenerator.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ Generator::Generator(SchemaOptions&& schemaOptions, GeneratorOptions&& options)
6565
throw std::logic_error("Unable to parse the request document, but there was no error "
6666
"message from the parser!");
6767
}
68+
69+
validateRequest();
6870
}
6971

7072
std::string Generator::getHeaderDir() const noexcept
@@ -109,7 +111,7 @@ std::string Generator::getSourcePath() const noexcept
109111
return fullPath.string();
110112
}
111113

112-
void Generator::validateQuery() const
114+
void Generator::validateRequest() const
113115
{
114116
auto schema = buildSchema();
115117
service::ValidateExecutableVisitor validation { schema };
@@ -1279,7 +1281,7 @@ std::future<service::ResolverResult> )cpp"
12791281
<< R"cpp(::resolve_client(service::ResolverParams&& params)
12801282
{
12811283
return service::ModifiedResult<service::Object>::convert(std::static_pointer_cast<service::Object>(std::make_shared<)cpp"
1282-
// << s_introspectionNamespace
1284+
<< SchemaLoader::getIntrospectionNamespace()
12831285
<< R"cpp(::Client>(_client)), std::move(params));
12841286
}
12851287
@@ -1290,13 +1292,13 @@ std::future<service::ResolverResult> )cpp"
12901292
auto argName = service::ModifiedArgument<response::StringType>::require("name", params.arguments);
12911293
const auto& baseType = _client->LookupType(argName);
12921294
std::shared_ptr<)cpp"
1293-
// << s_introspectionNamespace
1295+
<< SchemaLoader::getIntrospectionNamespace()
12941296
<< R"cpp(::object::Type> result { baseType ? std::make_shared<)cpp"
1295-
// << s_introspectionNamespace
1297+
<< SchemaLoader::getIntrospectionNamespace()
12961298
<< R"cpp(::Type>(baseType) : nullptr };
12971299
12981300
return service::ModifiedResult<)cpp"
1299-
// << s_introspectionNamespace
1301+
<< SchemaLoader::getIntrospectionNamespace()
13001302
<< R"cpp(::object::Type>::convert<service::TypeModifier::Nullable>(result, std::move(params));
13011303
}
13021304
)cpp";
@@ -1660,7 +1662,7 @@ int main(int argc, char** argv)
16601662
po::value(&headerDir),
16611663
"Target path for the <prefix>Client.h header file")("no-introspection",
16621664
po::bool_switch(&noIntrospection),
1663-
"Do not generate support for Introspection");
1665+
"Do not expect support for Introspection");
16641666
positional.add("schema", 1).add("request", 1).add("prefix", 1).add("namespace", 1);
16651667

16661668
try

0 commit comments

Comments
 (0)