Let's say the excel file name containing the sheet that we want to publish is "Book.xls" and it contains the sheet named "Sheet1".
So, normally in the Swagger API, we will set the target path address under the "Link Beans" as below -
----------------------------------------------------------------------------------------------
"targetPath": "/shared/excel_datasource/excel_poc/Book.xls/Sheet1"
----------------------------------------------------------------------------------------------
But this will generate the above-mentioned error.
Now, by just adding an escape character and double inverted commas before and after the excel file name solves the issue and can successfully publish the excel sheet.
Please refer below image as it explains how to get the correct file path and where to add the escape character and double inverted commas.
After following the steps, the path should look as below -
--------------------------------------------------------------------------------------------------
"targetPath": "/shared/excel_datasource/excel_poc/
\"Book.xls\"/Sheet1"
--------------------------------------------------------------------------------------------------