Skip to content

Commit a75340c

Browse files
committed
fix
1 parent 33e8c04 commit a75340c

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

rust/signed_doc/src/validator/rules/parameters.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@ impl ParametersRule {
4040
IsRequired::Excluded => {
4141
anyhow::ensure!(
4242
spec.doc_type.is_empty() && spec.multiple.is_none(),
43-
"'type' and 'multiple' fields could not been specified when 'required' is 'excluded' for 'template' metadata definition"
43+
"'type' and 'multiple' fields could not been specified when 'required' is 'excluded' for 'parameters' metadata definition"
4444
);
4545
return Ok(Self::NotSpecified);
4646
},
4747
};
4848

49-
anyhow::ensure!(!spec.doc_type.is_empty(), "'type' field should exists and has at least one entry for the required 'ref' metadata definition");
49+
anyhow::ensure!(!spec.doc_type.is_empty(), "'type' field should exists and has at least one entry for the required 'parameters' metadata definition");
5050
anyhow::ensure!(
5151
spec.multiple.is_some_and(|v| !v),
52-
"'multiple' field should be only set to false for the required 'reply' metadata definition"
52+
"'multiple' field should be only set to false for the required 'parameters' metadata definition"
5353
);
5454

5555
let allowed_type = spec.doc_type.iter().try_fold(

rust/signed_doc/src/validator/rules/reply.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl ReplyRule {
3737
IsRequired::Excluded => {
3838
anyhow::ensure!(
3939
spec.doc_type.is_empty() && spec.multiple.is_none(),
40-
"'type' and 'multiple' fields could not been specified when 'required' is 'excluded' for 'template' metadata definition"
40+
"'type' and 'multiple' fields could not been specified when 'required' is 'excluded' for 'reply' metadata definition"
4141
);
4242
return Ok(Self::NotSpecified);
4343
},

rust/signed_doc/src/validator/rules/template.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ impl TemplateRule {
4343

4444
anyhow::ensure!(
4545
spec.multiple.is_some_and(|v| !v),
46-
"'multiple' field should be only set to false for the required 'reply' metadata definition"
46+
"'multiple' field should be only set to false for the required 'template' metadata definition"
4747
);
4848
anyhow::ensure!(
4949
spec.required != IsRequired::Optional,
5050
"'required' field cannot been 'optional' for 'template' metadata definition"
5151
);
5252

53-
let doc_name = &<&[DocumentName; 1]>::try_from(spec.doc_type.as_slice()).map_err(|_| anyhow::anyhow!("'type' field should exists and has only one entry for the required 'reply' metadata definition"))?[0];
53+
let doc_name = &<&[DocumentName; 1]>::try_from(spec.doc_type.as_slice()).map_err(|_| anyhow::anyhow!("'type' field should exists and has only one entry for the required 'template' metadata definition"))?[0];
5454
let docs_spec = docs.get(&doc_name).ok_or(anyhow::anyhow!(
5555
"cannot find a document definition {doc_name}"
5656
))?;

0 commit comments

Comments
 (0)