@@ -189,22 +189,25 @@ The json must conform to the [TEA Well-Known Schema](tea-well-known.schema.json)
189189Example:
190190``` json
191191{
192+ "schemaVersion" : 1 ,
192193 "endpoints" : [
193194 {
194195 "url" : " https://api.teaexample.com" ,
195196 "versions" :
196197 [
197198 " 0.1.0-beta.1" ,
198199 " 0.2.0-beta.2" ,
199- " 1.0"
200- ]
200+ " 1.0.0"
201+ ],
202+ "priority" : 1
201203 },
202204 {
203205 "url" : " https://api2.teaexample.com/mytea" ,
204206 "versions" :
205207 [
206- " 1.0"
207- ]
208+ " 1.0.0"
209+ ],
210+ "priority" : 0.5
208211 }
209212 ]
210213}
@@ -214,7 +217,15 @@ Example:
214217## Connecting to the API
215218
216219Clients must pick any one of the endpoints listed in the ` .well-known/tea ` json
217- response. They must then construct the full URL to the API by appending the
220+ response. The client MUST pick an endpoint with the at least one version that is
221+ supported by the client is using. The client MUST prioritize endpoints with the
222+ highest matching version supported both by the client and the endpoint based on
223+ SemVer 2.0.0 specification comparison [ rules] ( https://semver.org/#spec-item-11 ) .
224+ If there are several endpoints like these and if the priority field is present,
225+ the client SHOULD pick the endpoint with the highest priority value (a float
226+ between 0 and 1).
227+
228+ The client must then construct the full URL to the API by appending the
218229"/v" plus one of the versions listed in the ` versions ` array of the selected endpoint,
219230plus "/discovery?tei=", plus the TEI that is url-encoded according to [ RFC3986]
220231and [ RFC3986] ).
@@ -223,7 +234,7 @@ Examples:
2232341 . For TEI ` urn:tei:uuid:products.example.com:d4d9f54a-abcf-11ee-ac79-1a52914d44b `
224235` https://api.teaexample.com/v0.2.0-beta.2/discovery?tei=urn%3Atei%3Auuid%3Aproducts.example.com%3Ad4d9f54a-abcf-11ee-ac79-1a52914d44b `
2252362 . For TEI
` urn:tei:purl:products.example.com:pkg:deb/debian/[email protected] ?arch=i386&distro=jessie ` 226- ` https://api2.teaexample.com/mytea/v1.0/discovery?tei=urn%3Atei%3Apurl%3Aproducts.example.com%3Apkg%3Adeb%2Fdebian%2Fcurl%407.50.3-1%3Farch%3Di386%26distro%3Djessie `
237+ ` https://api2.teaexample.com/mytea/v1.0.0 /discovery?tei=urn%3Atei%3Apurl%3Aproducts.example.com%3Apkg%3Adeb%2Fdebian%2Fcurl%407.50.3-1%3Farch%3Di386%26distro%3Djessie `
227238
228239The discovery endpoint is a part of the TEA OpenAPI specification.
229240
0 commit comments