Skip to content

Commit ca07c27

Browse files
authored
Registry spec disambiguation (#5938)
* Clarifies that the 'url' parameter is required for GET /identifiers * Disambiguates ordering of versions specifically by SemVer precedence
1 parent 7499b21 commit ca07c27

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

Documentation/Registry.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ The following terms, as used in this document, have the meanings indicated.
6666
- _Version Number_:
6767
An identifier for a package release
6868
in accordance with the [Semantic Versioning Specification (SemVer)][SemVer].
69+
- _Precedence_:
70+
The ordering of version numbers relative to each other
71+
as defined by the [Semantic Versioning Specification (SemVer)][SemVer].
6972

7073
## 3. Conventions
7174

@@ -375,11 +378,11 @@ A client SHOULD consider any releases with an associated `problem`
375378
to be unavailable for the purposes of package resolution.
376379

377380
A server SHOULD respond with
378-
a link to the latest published release of the package if one exists,
381+
a link to the highest precedence published release of the package if one exists,
379382
using a `Link` header field with a `latest-version` relation.
380383

381384
A server SHOULD list releases in order of precedence,
382-
starting with the latest version.
385+
starting with the highest precedence version.
383386
However, a client SHOULD NOT assume
384387
any specific ordering of versions in a response.
385388

@@ -469,11 +472,11 @@ The response body MUST contain a JSON object containing the following fields:
469472

470473
A server SHOULD respond with a `Link` header containing the following entries:
471474

472-
| Relation | Description |
473-
| --------------------- | -------------------------------------------------------------- |
474-
| `latest-version` | The latest published release of the package |
475-
| `successor-version` | The next published release of the package, if one exists |
476-
| `predecessor-version` | The previously published release of the package, if one exists |
475+
| Relation | Description |
476+
| --------------------- | ------------------------------------------------------------------------------------ |
477+
| `latest-version` | The highest precedence published release of the package |
478+
| `successor-version` | The next published release of the package ordered by precedence, if one exists |
479+
| `predecessor-version` | The previously published release of the package ordered by precedence, if one exists |
477480

478481
A link with the `latest-version` relation
479482
MAY correspond to the requested release.
@@ -769,7 +772,7 @@ Digest: sha-256=a2ac54cf25fbc1ad0028f03f0aa4b96833b83bb05a14e510892bb27dea4dc812
769772
### 4.5. Lookup package identifiers registered for a URL
770773

771774
A client MAY send a `GET` request
772-
for a URI matching the expression `/identifiers{?url}`
775+
for a URI matching the expression `/identifiers?url={url}`
773776
to retrieve package identifiers associated with a particular URL.
774777
A client SHOULD set the `Accept` header with the value
775778
`application/vnd.swift.registry.v1+json`.
@@ -780,6 +783,10 @@ Host: packages.example.com
780783
Accept: application/vnd.swift.registry.v1
781784
```
782785

786+
A client MUST provide a URL for the `url` query parameter.
787+
When no `url` parameter is specified,
788+
a server SHOULD respond with a status code of `400` (Bad Request).
789+
783790
If one or more package identifiers are associated with the specified URL,
784791
a server SHOULD respond with a status code of `200` (OK)
785792
and the `Content-Type` header `application/json`.

0 commit comments

Comments
 (0)