CRS Conversion V3 not working after Storage Spring 6 upgrade
When testing CRS Conversion V3 with integration tests, or manual postman collection, all the APIs are failing, with the error:
record not found: osdu:reference-data--CoordinateReferenceSystem:BoundProjected:EPSG::23032_EPSG::1612/
( notice the trailing slash - the specific CRS ID can change of course depending on your test )
The CRS IDs (in both the Postman collection provided or the integration tests JSON data) all ends with a trailing semi column, but without any specific version number defined after.
There is a small snippet of code in the CRS Conversion service (not in the test code) that convert this trailing :
to /
before making the query to the Storage service:
// temp should have record:version format. change last : to be / for storage API call
temp = temp.substring(0, temp.lastIndexOf(":")) + "/" + temp.substring(temp.lastIndexOf(":") + 1);
This worked before the Spring 6 upgrade of storage
, because trailing slashes were silently ignored, so a request to
/api/storage/v2/records/versions/osdu:reference-data--CoordinateReferenceSystem:BoundProjected:EPSG::29193_EPSG::1867/
(with a trailing /
) was routed to
/api/storage/v2/records/versions/osdu:reference-data--CoordinateReferenceSystem:BoundProjected:EPSG::29193_EPSG::1867
(without a trailing /
), which just retrieve the latest version of the record.
But with the spring 6 upgrade of storage
, this doesn't work anymore, and the record is not found, because the ID includes the slash
.
I think the Storage API is right, and this kind of requests with a trailing :
or /
, without a version number, should not be allowed.
So there are two ways to fix this on the CRS Conversion level, and my question is, which one to pick ?
- Continue to support the syntax in the input payload with a trailing
:
by just updating the small snippet of code linked above, to remove the trailing:
instead of replacing it with a/
. I tested this locally, and this works, the integration tests are passing - Directly update the JSON testing data and the postman collection to remove the trailing
:
and remove completely this small snippet of code. As far as I know, this is the only service where I saw this kind of syntax with a trailing:
and empty version number, so I think it would be cleaner to align with the other OSDU services. But could this break some usages ?