@@ -176,7 +176,7 @@ Valid `Accept` header field values are described by the following rules:
176
176
accept = "application/vnd.swift.registry" [".v" version] ["+" mediatype]
177
177
```
178
178
179
- A server SHALL set the ` Content-Type ` and ` Content-Version ` header fields
179
+ A server MUST set the ` Content-Type ` and ` Content-Version ` header fields
180
180
with the corresponding content type and API version number of the response.
181
181
182
182
``` http
@@ -316,6 +316,7 @@ containing the releases for the requested package.
316
316
HTTP/1.1 200 OK
317
317
Content-Type: application/json
318
318
Content-Version: 1
319
+ Content-Length: 508
319
320
Link: <https://github.com/mona/LinkedList>; rel="canonical",
320
321
<ssh://[email protected] :mona/LinkedList.git>; rel="alternate",
321
322
<https://packages.example.com/mona/LinkedList/1.1.1>; rel="latest-version",
@@ -341,7 +342,7 @@ Link: <https://github.com/mona/LinkedList>; rel="canonical",
341
342
}
342
343
```
343
344
344
- The response body SHALL contain a JSON object
345
+ The response body MUST contain a JSON object
345
346
nested at a top-level ` releases ` key,
346
347
whose keys are version numbers for releases and
347
348
whose values are objects containing the following fields:
@@ -426,8 +427,9 @@ Otherwise, a server SHOULD respond with a status code of `404` (Not Found).
426
427
427
428
``` http
428
429
HTTP/1.1 200 OK
429
- Content-Type: application/json
430
430
Content-Version: 1
431
+ Content-Type: application/json
432
+ Content-Length: 620
431
433
Link: <https://packages.example.com/mona/LinkedList/1.1.1>; rel="latest-version",
432
434
<https://packages.example.com/mona/LinkedList/1.0.0>; rel="predecessor-version"
433
435
```
@@ -504,7 +506,6 @@ Content-Type: text/x-swift
504
506
Content-Disposition: attachment; filename="Package.swift"
505
507
Content-Length: 361
506
508
Content-Version: 1
507
- ETag: 87e749848e0fc4cfc509e4090ca37773
508
509
Link: <http://packages.example.com/mona/LinkedList/Package.swift?swift-version=4>; rel="alternate",
509
510
<http://packages.example.com/mona/LinkedList/Package.swift?swift-version=4.2>; rel="alternate"
510
511
@@ -566,7 +567,6 @@ Content-Type: text/x-swift
566
567
Content-Disposition: attachment; filename="[email protected] "
567
568
Content-Length: 361
568
569
Content-Version: 1
569
- ETag: 24f6cd72352c4201df22a5be356d4d22
570
570
571
571
// swift-tools-version:4.2
572
572
import PackageDescription
@@ -625,16 +625,15 @@ Content-Disposition: attachment; filename="LinkedList-1.1.1.zip"
625
625
Content-Length: 2048
626
626
Content-Version: 1
627
627
Digest: sha-256=a2ac54cf25fbc1ad0028f03f0aa4b96833b83bb05a14e510892bb27dea4dc812
628
- ETag: e61befdd5056d4b8bafa71c5bbb41d71
629
628
Link: <https://mirror-japanwest.example.com/mona-LinkedList-1.1.1.zip>; rel=duplicate; geo=jp; pri=10; type="application/zip"
630
629
```
631
630
632
- A server SHALL respond with a ` Content-Length ` header
631
+ A server MUST respond with a ` Content-Length ` header
633
632
set to the size of the archive in bytes.
634
633
A client SHOULD terminate any requests whose response exceeds
635
634
the expected content length.
636
635
637
- A server SHALL respond with a ` Digest ` header
636
+ A server MUST respond with a ` Digest ` header
638
637
containing a SHA-256 checksum for the source archive.
639
638
640
639
A server SHOULD respond with a ` Content-Disposition ` header
@@ -648,7 +647,7 @@ and caching as described by [RFC 7234].
648
647
649
648
#### 4.4.1. Integrity verification
650
649
651
- A client SHOULD verify the integrity of a downloaded source archive
650
+ A client MUST verify the integrity of a downloaded source archive
652
651
using the checksum provided in the ` Digest ` header of a response
653
652
(for example, using the command
654
653
` echo "$CHECKSUM LinkedList-1.1.1.zip" | shasum -a 256 -c ` ).
@@ -663,15 +662,22 @@ A client MAY use this information
663
662
to determine its preferred strategy for downloading.
664
663
665
664
A server that indexes but doesn't host packages
666
- SHOULD respond with a status code of ` 303 ` (See Other)
665
+ MAY respond with a status code of ` 303 ` (See Other)
667
666
and redirect to a hosted package archive if one is available.
668
667
669
668
``` http
670
669
HTTP/1.1 303 See Other
671
670
Content-Version: 1
671
+ Content-Length: 2048
672
+ Digest: sha-256=a2ac54cf25fbc1ad0028f03f0aa4b96833b83bb05a14e510892bb27dea4dc812
672
673
Location: https://packages.example.com/mona/LinkedList/1.1.1.zip
673
674
```
674
675
676
+ The client SHOULD consider the ` Digest ` and ` Content-Length ` headers
677
+ sent in the response to be authoritative for the redirected resource.
678
+ The client MUST NOT follow redirects that downgrade to an insecure connection.
679
+ The client SHOULD limit the number of redirects to prevent a redirect loop.
680
+
675
681
<a name =" endpoint-5 " ></a >
676
682
677
683
### 4.5 Lookup package identifiers registered for a URL
@@ -708,7 +714,7 @@ Content-Version: 1
708
714
}
709
715
```
710
716
711
- The response body SHALL contain an array of package identifier strings
717
+ The response body MUST contain an array of package identifier strings
712
718
nested at a top-level ` identifiers ` key.
713
719
714
720
It is RECOMMENDED for clients and servers to support
@@ -770,6 +776,7 @@ paths:
770
776
tags :
771
777
- Package
772
778
summary : List package releases
779
+ operationId : listPackageReleases
773
780
parameters :
774
781
- name : Content-Type
775
782
in : header
@@ -783,6 +790,9 @@ paths:
783
790
headers :
784
791
Content-Version :
785
792
$ref : " #/components/headers/contentVersion"
793
+ Content-Length :
794
+ schema :
795
+ type : integer
786
796
content :
787
797
application/json :
788
798
schema :
@@ -801,6 +811,7 @@ paths:
801
811
tags :
802
812
- Release
803
813
summary : Fetch release metadata
814
+ operationId : fetchReleaseMetadata
804
815
parameters :
805
816
- name : Content-Type
806
817
in : header
@@ -814,6 +825,9 @@ paths:
814
825
headers :
815
826
Content-Version :
816
827
$ref : " #/components/headers/contentVersion"
828
+ Content-Length :
829
+ schema :
830
+ type : integer
817
831
content :
818
832
application/json :
819
833
schema :
@@ -832,6 +846,7 @@ paths:
832
846
tags :
833
847
- Release
834
848
summary : Fetch manifest for a package release
849
+ operationId : fetchManifestForPackageRelease
835
850
parameters :
836
851
- name : Content-Type
837
852
in : header
@@ -855,9 +870,6 @@ paths:
855
870
type : integer
856
871
Content-Version :
857
872
$ref : " #/components/headers/contentVersion"
858
- Etag :
859
- schema :
860
- type : string
861
873
Link :
862
874
schema :
863
875
type : string
@@ -879,6 +891,7 @@ paths:
879
891
tags :
880
892
- Release
881
893
summary : Download source archive
894
+ operationId : downloadSourceArchive
882
895
parameters :
883
896
- name : Content-Type
884
897
in : header
@@ -908,9 +921,6 @@ paths:
908
921
required : true
909
922
schema :
910
923
type : string
911
- Etag :
912
- schema :
913
- type : string
914
924
Link :
915
925
schema :
916
926
type : string
@@ -919,6 +929,8 @@ paths:
919
929
schema :
920
930
type : string
921
931
format : binary
932
+ 3XX :
933
+ $ref : " #/components/responses/redirect"
922
934
4XX :
923
935
$ref : " #/components/responses/problemDetails"
924
936
/identifiers :
@@ -928,6 +940,7 @@ paths:
928
940
tags :
929
941
- Package
930
942
summary : Lookup package identifiers registered for a URL
943
+ operationId : lookupPackageIdentifiersByURL
931
944
parameters :
932
945
- name : Content-Type
933
946
in : header
@@ -1012,10 +1025,27 @@ components:
1012
1025
Content-Language :
1013
1026
schema :
1014
1027
type : string
1028
+ Content-Length :
1029
+ schema :
1030
+ type : integer
1015
1031
content :
1016
1032
application/problem+json :
1017
1033
schema :
1018
1034
$ref : " #/components/schemas/problem"
1035
+ redirect :
1036
+ description : A server redirect.
1037
+ headers :
1038
+ Content-Version :
1039
+ $ref : " #/components/headers/contentVersion"
1040
+ Location :
1041
+ schema :
1042
+ type : string
1043
+ Digest :
1044
+ schema :
1045
+ type : string
1046
+ Content-Length :
1047
+ schema :
1048
+ type : integer
1019
1049
parameters :
1020
1050
scope :
1021
1051
name : scope
0 commit comments