@@ -66,6 +66,9 @@ The following terms, as used in this document, have the meanings indicated.
66
66
- _ Version Number_ :
67
67
An identifier for a package release
68
68
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 ] .
69
72
70
73
## 3. Conventions
71
74
@@ -375,11 +378,11 @@ A client SHOULD consider any releases with an associated `problem`
375
378
to be unavailable for the purposes of package resolution.
376
379
377
380
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,
379
382
using a ` Link ` header field with a ` latest-version ` relation.
380
383
381
384
A server SHOULD list releases in order of precedence,
382
- starting with the latest version.
385
+ starting with the highest precedence version.
383
386
However, a client SHOULD NOT assume
384
387
any specific ordering of versions in a response.
385
388
@@ -469,11 +472,11 @@ The response body MUST contain a JSON object containing the following fields:
469
472
470
473
A server SHOULD respond with a ` Link ` header containing the following entries:
471
474
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 |
477
480
478
481
A link with the ` latest-version ` relation
479
482
MAY correspond to the requested release.
@@ -769,7 +772,7 @@ Digest: sha-256=a2ac54cf25fbc1ad0028f03f0aa4b96833b83bb05a14e510892bb27dea4dc812
769
772
### 4.5. Lookup package identifiers registered for a URL
770
773
771
774
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} `
773
776
to retrieve package identifiers associated with a particular URL.
774
777
A client SHOULD set the ` Accept ` header with the value
775
778
` application/vnd.swift.registry.v1+json ` .
@@ -780,6 +783,10 @@ Host: packages.example.com
780
783
Accept: application/vnd.swift.registry.v1
781
784
```
782
785
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
+
783
790
If one or more package identifiers are associated with the specified URL,
784
791
a server SHOULD respond with a status code of ` 200 ` (OK)
785
792
and the ` Content-Type ` header ` application/json ` .
0 commit comments