gbv / jskos-server

Web service to access JSKOS data
https://coli-conc.gbv.de/api/
MIT License
6 stars 4 forks source link

GET /mappings: `direction` parameter does not work properly when `fromScheme` or `toScheme` are given #207

Closed stefandesu closed 1 year ago

stefandesu commented 1 year ago

Easy example: https://coli-conc.gbv.de/api/mappings?from=33&fromScheme=http%3A%2F%2Fbartoc.org%2Fen%2Fnode%2F18785&direction=both

We are requesting mappings from BK 33 in both directions. However, what is returned is a mapping from DDC 33 to a different BK concepts. This means that currently, fromScheme/toScheme are swapped independently of from/to when direction is "both".

stefandesu commented 1 year ago

This is now fixed, but note that I changed the logic of how the parameters work. Now, from/fromScheme and to/toScheme always belong together, so if both are given, they are always connected with an "and" logic. I consider this a fix rather than a breaking change because this is actually the intended behavior and should be more intuitive as well.

Example /mappings?from=612.112&fromScheme=GND&mode=or:

This change only affected a single test (which didn't really make sense previously, in my opinion), and it should be such an edge case that I don't think it will affect anyone.