diff --git a/src/main/resources/io/jenkins/plugins/traceable/ast/TraceableApiInspectorStepBuilder/config.jelly b/src/main/resources/io/jenkins/plugins/traceable/ast/TraceableApiInspectorStepBuilder/config.jelly index e3ea9ca..18e0d0c 100644 --- a/src/main/resources/io/jenkins/plugins/traceable/ast/TraceableApiInspectorStepBuilder/config.jelly +++ b/src/main/resources/io/jenkins/plugins/traceable/ast/TraceableApiInspectorStepBuilder/config.jelly @@ -11,8 +11,8 @@ diff --git a/src/main/resources/io/jenkins/plugins/traceable/ast/shell_scripts/api_inspector.sh b/src/main/resources/io/jenkins/plugins/traceable/ast/shell_scripts/api_inspector.sh index 4a268af..c4af53d 100644 --- a/src/main/resources/io/jenkins/plugins/traceable/ast/shell_scripts/api_inspector.sh +++ b/src/main/resources/io/jenkins/plugins/traceable/ast/shell_scripts/api_inspector.sh @@ -4,7 +4,6 @@ GRAPHQL_ENDPOINT="https://$1/graphql" API_ENDPOINT="https://$1/rest/v2/upload/documentation/openapi" PLATFORM_TOKEN="$2" SPEC_PATH="$3" -echo $SPEC_PATH FILE_NAME=$(basename "$SPEC_PATH") GRAPHQL_QUERY='mutation { createApiSpec( diff --git a/src/main/resources/io/jenkins/plugins/traceable/ast/shell_scripts/spec_finder.sh b/src/main/resources/io/jenkins/plugins/traceable/ast/shell_scripts/spec_finder.sh index 60c0fc3..d11fe26 100644 --- a/src/main/resources/io/jenkins/plugins/traceable/ast/shell_scripts/spec_finder.sh +++ b/src/main/resources/io/jenkins/plugins/traceable/ast/shell_scripts/spec_finder.sh @@ -1,6 +1,8 @@ # Search for OpenAPI 3.x.x specifications -spec_files=$(find "${1}" -type f \( -name "*.yaml" -o -name "*.yml" -o -name "*.json" \) -print0 | xargs -0 grep -l -e "openapi: 3" -e "\"openapi\": 3") +spec_files=$(find "${1}" -type f \( -name "*.yaml" -o -name "*.yml" -o -name "*.json" \) -print0 | xargs -0 grep -l -E '^\s*("openapi"|openapi)?\s*:\s*("3\.[0-9]+\.[0-9]+"|3\.[0-9]+\.[0-9]+)\s*') +spec_files="$spec_files"$'\n' # Search for Swagger 2.0 specifications -spec_files+=$(find "${1}" -type f \( -name "*.yaml" -o -name "*.yml" -o -name "*.json" \) -print0 | xargs -0 grep -l -e "swagger: \"2.0\"" -e "\"swagger\": \"2.0\"" ) -echo "$spec_files" +spec_files+=$(find "${1}" -type f \( -name "*.yaml" -o -name "*.yml" -o -name "*.json" \) -print0 | xargs -0 grep -l -E '^\s*("swagger"|swagger)?\s*:\s*("2\.0"|2\.0)\s*') + +echo "$spec_files" \ No newline at end of file