File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -40,9 +40,18 @@ function Submit-Request($filePath, $packageName)
4040 $query.Add (' language' , $LanguageShort )
4141 $query.Add (' project' , $DevopsProject )
4242 $reviewFileFullName = Join-Path - Path $ArtifactPath $packageName $reviewFileName
43+ # If CI generates token file then it passes both token file name and original file (filePath) to APIView
44+ # If both files are passed then APIView downloads the parent directory as a zip
45+ # If code file is not passed(for e.g. .NET or Java) then APIView needs full path to original file to download only that file.
4346 if (Test-Path $reviewFileFullName )
4447 {
4548 $query.Add (' codeFile' , $reviewFileName )
49+ # Pass only relative path in package artifact directory when code file is also present
50+ $query.Add (' filePath' , (Split-Path - Leaf $filePath ))
51+ }
52+ else
53+ {
54+ $query.Add (' filePath' , $filePath )
4655 }
4756 $uri = [System.UriBuilder ]$APIViewUri
4857 $uri.query = $query.toString ()
You can’t perform that action at this time.
0 commit comments