diff --git a/docs/persistent-identifiers.rst b/docs/persistent-identifiers.rst --- a/docs/persistent-identifiers.rst +++ b/docs/persistent-identifiers.rst @@ -4,7 +4,7 @@ SoftWare Heritage persistent IDentifiers (SWHIDs) ================================================= -**version 1.5, last modified 2020-05-14** +**version 1.6, last modified 2021-04-12** .. contents:: :local: @@ -228,6 +228,24 @@ maintained in future versions of this scheme (or Git). +Automatically fixing invalid SWHIDs +----------------------------------- + +User interfaces may fix invalid SWHIDs, by removing leading or trailing characters +inserted by user error (such as a trailing slash, caused by copy-pasting one character +too many from a ``https://archive.softwareheritage.org/`` URL). + +User interfaces should show an error when such an automatic fix occurs, +so users have a chance to fix their SWHID before pasting it to an other interface +that does not perform the same corrections. + +Finally, implementations should take great care not to accidentally correct +a valid SWHID (eg. the ``origin`` qualifier's value may end with a slash); +for example by checking if a SWHID exists before fixing it. +APIs should not attempt to fix SWHIDs, to avoid silent changes (or even corruptions) +in the middle of data processing pipelines. + + Examples ========