Make the treatment of leading, trailing and multiple slashes in Jobs API input and output parameters conform to Tapis Path Type as described below.
Tapis Path Types have:
A leading slash
No trailing slash
No multiple slash sequences
Tapis Paths are relative to some Tapis-defined directory and ultimately to the rootDir of a system.
Generally, we take the Forgiving approach (see below) when accepting path inputs from users, though certain situations may warrant the Unforgiving approach. The Forgiving approach fixes up user input that does not have a leading slash by prepending one and by dropping any trailing slashes. We also collapse sequences of multiple slashes into a single slash ("///" → "/"). Services are expected to exchange Tapis Path Types between each other in most circumstances.
There are contexts, however, where paths cannot conform to the Tapis Path Type. For instance, search and filter specifications that rely on string matching treat slashes as significant characters, so fix-ups may not be appropriate. This is especially true when wildcards are allowed. Also, paths embedded in URLs may ascribe a particular meaning to leading or trailing slashes. Individual services must make clear how they interpret these special cases.
Approaches
Forgiving: Add a leading slash to inputs if the user doesn't provide one.
The canonical representation of paths in Tapis is to have a leading slash. Prepend a leading slash to inputs that don't have one and then save.
Unforgiving: Require leading slashes.
The canonical representation of paths in Tapis is to have a leading slash. Inputs without leading slashes are rejected.
Make the treatment of leading, trailing and multiple slashes in Jobs API input and output parameters conform to Tapis Path Type as described below.
Tapis Path Types have:
Generally, we take the Forgiving approach (see below) when accepting path inputs from users, though certain situations may warrant the Unforgiving approach. The Forgiving approach fixes up user input that does not have a leading slash by prepending one and by dropping any trailing slashes. We also collapse sequences of multiple slashes into a single slash ("///" → "/"). Services are expected to exchange Tapis Path Types between each other in most circumstances.
There are contexts, however, where paths cannot conform to the Tapis Path Type. For instance, search and filter specifications that rely on string matching treat slashes as significant characters, so fix-ups may not be appropriate. This is especially true when wildcards are allowed. Also, paths embedded in URLs may ascribe a particular meaning to leading or trailing slashes. Individual services must make clear how they interpret these special cases.
Approaches