I have a very odd situation. I have an API endpoint which has to accept requests to list all the resources available for the given endpoint and list a specific resource. The endpoint looks like this :
/v1/patients
I can call this without passing any path variables and it will list all patient records. Here comes the special case - If I want to fetch only one patient, I have to pass in the Patient number as path variable - and My patient number looks something like this - 2019/patientname/October/27 - and that is the problem.
when I pass the above number as path variable, I will not get the resource I wanted, instead Spring considers the slashes "/" as separators.
Example :
/v1/patients/2019/patientname/October/27
And I am getting the response like given path is not found - of course there is no path like that.
Is there a possibility of Ignoring all the slashes in between this one Patient number?
Edit : There is no possibility of changing the Patient number as it is part of a very old and legacy code-base, on which the whole system is running.
Edit 2 - URL encoding cannot be used in this situation - this patient number has to be passed in as it is - Situation is very insane.