OCM-API
OCM-API copied to clipboard
Can we drop `singleProtocolNew`?
Related to #104.
Looking at the API spec there are 3 ways to specify that WebDAV and nothing else is offered:
- name: 'webdav', details in 'options' (
singleProtocolLegacy) - name: 'webdav', details in 'webdav' (
singleProtocolNew) -> why do we need this? - name: 'multi', details in 'webdav' (
multipleProtocols)
Can we remove the second one?
Note that if we decide to drop name in #104 then 2. and 3. automatically become identical.
The case 2. was provided as an example of an implementation that would use the "new" format even for the case where the offered protocol is a single one (I'm sure we can find some relevant discussion in the PRs from last year - and yes this would be granted an ADR record!). Reva is one such implementation where we went straight for the new format in all cases.
But then why do you set name to webdav and not to multi?
If you set it to multi then it would be correct, the receiving implementation would just loop over the keys of the object, for this loop it doesn't matter if it's 1,2 or 3 entries.
But by setting name to webdav you're forcing the receiving implementation to add an extra if statement to treat name webdav as equivalent to name multi.
That's a fair point indeed, and in Reva we did as you suggested: multi is "hardcoded" and we populate the protocols as requested or configured.
Shall we just modify the singleProtocolNew example to say multi? Still better than dropping it completely I guess.