diff --git a/.schema-validator-version b/.schema-validator-version index 5f4f91fb..40ed1335 100644 --- a/.schema-validator-version +++ b/.schema-validator-version @@ -1 +1 @@ -v8.0.0 +v9.0.0 diff --git a/scripts/validate_schemas.sh b/scripts/validate_schemas.sh index 02c60adb..0e7c754b 100755 --- a/scripts/validate_schemas.sh +++ b/scripts/validate_schemas.sh @@ -39,8 +39,8 @@ passed=0 file_path_name=$(find "$file_path" -name '*.json') -for schema in ${file_path_name}; do - +validate() { + schema=$1 result="$(curl -s -w 'HTTPSTATUS:%{http_code}' -X POST -H "Content-Type: application/json" -d @"$schema" http://localhost:5001/validate | tr -d '\n')" # shellcheck disable=SC2001 HTTP_BODY=$(echo "${result}" | sed -e 's/HTTPSTATUS\:.*//g') @@ -57,9 +57,16 @@ for schema in ${file_path_name}; do (( failed++ )) exit=1 fi +} + +N_TIMES_IN_PARALLEL=20 + +for schema in ${file_path_name}; do + ((i=i%N_TIMES_IN_PARALLEL)); ((i++==0)) && wait +# Spawn multiple (N_TIMES_IN_PARALLEL) processes in subshells and send to background, but keep printing outputs. + validate "$schema" & done -echo -e "\\n${green}$passed Passed${default} - ${red}$failed Failed${default}" exit "$exit"