[
https://issues.apache.org/jira/browse/MINIFI-294?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15995956#comment-15995956
]
ASF GitHub Bot commented on MINIFI-294:
---------------------------------------
Github user benqiu2016 commented on a diff in the pull request:
https://github.com/apache/nifi-minifi-cpp/pull/90#discussion_r114679611
--- Diff: libminifi/src/core/yaml/YamlConfiguration.cpp ---
@@ -450,27 +436,24 @@ void YamlConfiguration::parseConnectionYaml(
} else {
// we ran out of ways to discover the source processor
logger_->log_error(
- "Could not locate a source with name %s to create a
connection",
- connectionSrcProcName);
+ "Could not locate a source with name %s to create a
connection", connectionSrcProcName);
throw std::invalid_argument(
- "Could not locate a source with name " +
- connectionSrcProcName + " to create a connection ");
+ "Could not locate a source with name " +
connectionSrcProcName + " to create a connection ");
}
}
}
connection->setSourceUUID(srcUUID);
// Configure connection destination
uuid_t destUUID;
- std::string connectionDestProcName = connectionNode["destination
name"]
- .as<std::string>();
if (connectionNode["destination id"]) {
- std::string connectionDestProcId = connectionNode["destination
id"]
- .as<std::string>();
+ std::string connectionDestProcId = connectionNode["destination
id"].as<std::string>();
uuid_parse(connectionDestProcId.c_str(), destUUID);
} else {
// we use the same logic as above for resolving the source
processor
// for looking up the destination processor in absence of a
processor id
+ checkRequiredField(&connectionNode, "destination name",
CONFIG_YAML_CONNECTIONS_KEY);
--- End diff --
same as above.
> Better handling of required vs. optional fields in config schema v1
> -------------------------------------------------------------------
>
> Key: MINIFI-294
> URL: https://issues.apache.org/jira/browse/MINIFI-294
> Project: Apache NiFi MiNiFi
> Issue Type: Bug
> Components: C++, Documentation, Processing Configuration
> Reporter: Kevin Doran
> Assignee: Kevin Doran
> Priority: Critical
> Fix For: cpp-0.2.0
>
>
> This is a followup task to MINIFI-275. While the scope of MINIFI-275 was
> minifi-cpp processing of components without id fields, which are optional in
> config schema v1, this ticket covers all fields for all component types,
> either doing string checks for required fields (with useful error messages if
> absent) or graceful handling of missing optional fields.
> The Config Schema V1 in the minifi-java codebase will be used as a guide for
> which fields to treat as required and which to treat as optional. [~aldrin] -
> please confirm that is the correct assumption for minifi-cpp. The Java
> implementation can be found at [1]. Specifically, in the Java code, required
> fields are loaded using `getRequiredKeyAsType() and optional fields are
> loaded using `getOptionalKeyAsType()`
> Also in scope for this ticket is to update the config.yml examples in the
> minifi-cpp README.md file to make sure they are not missing required fields.
> During testing, it was found that one example config.yml is missing source
> name and destination name, which are required in config schema v1.
> [1]
> https://github.com/apache/nifi-minifi/tree/master/minifi-commons/minifi-commons-schema/src/main/java/org/apache/nifi/minifi/commons/schema/v1
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)