Skip to content

Commit 94d10a4

Browse files
authored
Replace dataset_version with dataset and blob urls (#222)
1 parent ff632d1 commit 94d10a4

1 file changed

Lines changed: 24 additions & 19 deletions

File tree

spec/api/api.yaml

Lines changed: 24 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@ info:
4646
```
4747
4848
Changes
49+
2.0.0 (06/13/2025)
50+
* This is a breaking change: CBLTest-API-Version is now "2"
51+
* deprecate dataset_version
52+
* In ResetConfiguration, change the value for the "dataset" key to a url.
53+
4954
1.2.1 (06/04/2025)
5055
* Add authenticator property to [/startMultipeerReplicator](#operation/startMultipeerReplicator)
5156
@@ -330,20 +335,21 @@ paths:
330335
- **updatedBlobs**:
331336
332337
A dictionary whose keys are the key paths into the document to be updated with the blob objects and values are
333-
the blob file names listed in the blob dataset.
338+
the urls from which to retrieve the blobs to be put at the key path location.
334339
335340
The logic to update blobs is similar to the logic when updating properties. The value at the location specified
336-
by the keypath is replaced with the blob object in the object regardless of its type. When a path in the keypath
337-
refers to a non-existent property, the key is added and its value set as a dictionary or an array depending on
341+
by the keypath is replaced with the blob object regardless of the value's type. When a path in the keypath
342+
refers to a non-existent property, the key is added and its value set as a dictionary or an array depending on
338343
the type of the path. When a path in the keypath includes an array index that is out of bounds, the array
339344
is padded with nulls until it is exactly large enough to make the specified index legal.
340345
341-
The blob object is created from the content of the blob file refered by the blob file name, the dictionary value
342-
associated with each key path. If the blob file name refers to non-existing blob file, 400 request error will
343-
be returned.
346+
The blob object is created from the content of the blob file to which the blob url refers: the value associated
347+
with the keypath in the request. If the name of the file retrieved from the url ends with the extension ".zip"
348+
the file is unzipped, first, to recover the blob. If the blob file name refers to non-existing blob file,
349+
a 400 request error will be returned.
344350
345351
The content_type of the blob used when creating a blob object can be detected from the blob file name's extension
346-
as the following rules:
352+
(after it is unzipped, if necessary) according to the following rules:
347353
* "image/jpeg" for the .jpg
348354
* "application/octet-stream" for others
349355
@@ -1044,10 +1050,10 @@ components:
10441050
example: ['people[22].address', 'people[3]']
10451051
updatedBlobs:
10461052
description: A dictionary whose keys are the key paths into the document to be updated with the
1047-
blob objects and values are the blob keys in the dataset.
1053+
blob objects and values are the urls from which to obtain the blob files.
10481054
type: object
10491055
additionalProperties: {}
1050-
example: {'photo.thumbnail': 's1.jpg'}
1056+
example: {'photo.thumbnail': 'https://media.githubusercontent.com/media/blob/s1.jpg'}
10511057
Error:
10521058
type: object
10531059
required: ['domain', 'code']
@@ -1084,10 +1090,6 @@ components:
10841090
description: The Session ID to appear in the header of all subsequent requests
10851091
type: string
10861092
example: 'c64aae38-87c1c-4524-823a-e267fc39c3c4'
1087-
dataset_version:
1088-
description: The version of the dataset to use for this session (default 3.2)
1089-
type: string
1090-
example: 4.0
10911093
logging:
10921094
type: object
10931095
required: ['url', 'tag']
@@ -1327,9 +1329,9 @@ components:
13271329
* Null or an empty dictionary for creating an empty database.
13281330
* A dictionary contains a single key named "collections", with a list of the collection names
13291331
as its value, for creating a database with those collections.
1330-
* A dictionary contains a single key named contains a key named "dataset",
1331-
with a dataset name as its value, for creating a database from the specified dataset
1332-
which is a prebuilt database. '
1332+
* A dictionary that contains the single key "dataset",
1333+
whose value is the url for a dataset. A dataset is a file named <dbname>.cblite2.zip
1334+
which when unzipped is the prebuilt database named <dbname>.
13331335
type: object
13341336
properties:
13351337
test:
@@ -1356,10 +1358,13 @@ components:
13561358
example: ["_default.employees", "_default.departments"]
13571359
- properties:
13581360
dataset:
1359-
description: 'Dataset name. Cannot be used together with collections.'
1361+
description: 'Dataset url. Cannot be used together with collections.'
13601362
type: string
1361-
example: "travel"
1362-
example: {'db1': {}, 'db2': {'collections': ["_default.employees"]}, 'db3': {'dataset': "travel"}}
1363+
example: "https://media.githubusercontent.com/media/couchbaselabs/couchbase-lite-tests/refs/heads/main/dataset/4.0/travel.cblite2.zip"
1364+
example: {
1365+
'db1': {},
1366+
'db2': {'collections': ["_default.employees"]},
1367+
'db3': {'dataset': "https://media.githubusercontent.com/media/couchbaselabs/couchbase-lite-tests/refs/heads/main/dataset/4.0/travel.cblite2.zip"}}
13631368
ServerInfo:
13641369
type: object
13651370
required: ['version', 'apiVersion', 'cbl', 'device']

0 commit comments

Comments
 (0)