Skip to content

Commit

Permalink
launch: improve validation warning for unexpected properties
Browse files Browse the repository at this point in the history
Change the validation warning issued when unexpected properties are
found in the REANA specification to include the path to were the
invalidating keywords were found.

Closes reanahub/reana-client#679.
  • Loading branch information
giuseppe-steduto committed Nov 28, 2023
1 parent 654183c commit 153562e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion reana-ui/src/pages/launchOnReana/LaunchOnReana.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,16 @@ export default function LaunchOnReana() {
// Iterate over all keys in validation_warning
for (const key in validation_warnings) {
if (key === "additional_properties") {
const properties = validation_warnings[key].join(", ");
const properties = validation_warnings[key]
.map(
(additionalProperty) =>
`${additionalProperty.property}${
additionalProperty.path
? ` (at ${additionalProperty.path})`
: ""
}`,
)
.join(", ");
warningMessages.push(
`Unexpected properties found in the REANA specification: ${properties}.`,
);
Expand Down

0 comments on commit 153562e

Please sign in to comment.