Removed redundant message field

This commit is contained in:
Uwe Seimet 2021-12-17 23:19:08 +01:00
parent ff468aafa8
commit 49e14f7078
3 changed files with 2 additions and 4 deletions

View File

@ -169,9 +169,8 @@ message PbOperationParameter {
string type = 3;
// There is no specific set of values if empty
repeated string values = 4;
// Optional default value
// Optional default value. If there is no default the value is mandatory.
string default_value = 5;
bool is_mandatory = 6;
}
// The list of parameters supported by an operation

View File

@ -457,7 +457,6 @@ PbOperationParameter *RascsiResponse::AddOperationParameter(PbOperationParameter
if (!default_value.empty()) {
parameter->set_default_value(default_value);
}
parameter->set_is_mandatory(default_value.empty());
return parameter;
}

View File

@ -290,7 +290,7 @@ void RasctlDisplay::DisplayOperationInfo(const PbOperationInfo& operation_info)
for (const auto& parameter : operation.parameters()) {
cout << " " << parameter.name() << ": " << parameter.type()
<< (parameter.is_mandatory() ? ", mandatory" : ", optional");
<< (parameter.default_value().empty() ? ", mandatory" : ", optional");
if (!parameter.description().empty()) {
cout << " (" << parameter.description().at("en") << ")";
}