plantbreeding / IPK-BrAPI-Validator

MIT License
4 stars 3 forks source link

404 status code on services that include a DbId in the call URL #79

Open Gabriel-Besombes opened 1 year ago

Gabriel-Besombes commented 1 year ago

Hi, I have started to try this tool today but encountered issues with all services that include a DbId in the call URL. For example : GET /studies/{studyDbId}. I get 404s on all of these.

I am using the docker version.

I believe it could simply be due to URL encoding issues. Our DbIds are URIs so they may contain special characters like ":" or "/". For example : "dev:id/experiment/test" should be encoded in the URL as "http://localhost:8666/rest/brapi/v1/studies/dev%3Aid%2Fexperiment%2Ftest".

This is a bit hard to verify though as the app doesn't tell the user what URL was called, with what parameters or what the complete response was. I can submit a different issue for an improvement if necessary.

PS : BrAPI version 1.3

Gabriel-Besombes commented 1 year ago

I was able to fix this issue localy. It looks like the "/" in DbIds cause issues with RestAssured's encoding. I fixed this by storing all DbIds URLencoded and deactivating RestAssured's URLencoding. My fix isn't perfect and I didn't test it properly but I can still make a PR if you are interested.

I also added querry parameters and result logging for help in debugging. This could also be added to the app inteface to help with troubleshooting.