Skip to content

Commit 3f351f8

Browse files
authored
chore(cirrus): update readme to clearly differentiate v1 and v2 api outputs (#13771)
Because - I was about to link the readme to fxa and I couldn't readily tell which outputs i was looking at This commit - Changes the output section headers to specify the api version of the output described, and separates them from the curl examples - Fixes the incorrectly lower-case `Features` v2 api output key - Fixes some v1 api language to not indicate there is a `features` key in the response Fixes #github_issue_number
1 parent 082da41 commit 3f351f8

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

cirrus/README.md

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ Example input:
226226
Example usage with nimbus_preview query parameter:
227227

228228
```shell
229+
# v1 api
229230
curl -X POST "http://localhost:8001/v1/features/?nimbus_preview=true" -H 'Content-Type: application/json' -d '{
230231
"client_id": "4a1d71ab-29a2-4c5f-9e1d-9d9df2e6e449",
231232
"context": {
@@ -235,11 +236,22 @@ curl -X POST "http://localhost:8001/v1/features/?nimbus_preview=true" -H 'Conten
235236
}'
236237
```
237238

238-
### Output
239+
```shell
240+
# v2 api
241+
curl -X POST "http://localhost:8001/v2/features/?nimbus_preview=true" -H 'Content-Type: application/json' -d '{
242+
"client_id": "4a1d71ab-29a2-4c5f-9e1d-9d9df2e6e449",
243+
"context": {
244+
"language": "en",
245+
"region": "US"
246+
}
247+
}'
248+
```
239249

240-
The output will be a JSON object with the following properties:
250+
## Output
251+
252+
### V1 API Output
241253

242-
- `features` (object): An object that contains the set of features. Each feature is represented as a sub-object with its own set of variables.
254+
The output will be a JSON object where each feature is represented as a sub-object with its own set of variables.
243255

244256
Example output:
245257

@@ -260,21 +272,13 @@ Example output:
260272
}
261273
```
262274

263-
```shell
264-
curl -X POST "http://localhost:8001/v2/features/?nimbus_preview=true" -H 'Content-Type: application/json' -d '{
265-
"client_id": "4a1d71ab-29a2-4c5f-9e1d-9d9df2e6e449",
266-
"context": {
267-
"language": "en",
268-
"region": "US"
269-
}
270-
}'
271-
```
272275

273-
### Output
276+
277+
### V2 API Output
274278

275279
The output will be a JSON object with the following properties:
276280

277-
- `features` (object): An object that contains the set of features. Each feature is represented as a sub-object with its own set of variables.
281+
- `Features` (object): An object that contains the set of features. Each feature is represented as a sub-object with its own set of variables.
278282
- `Enrollments` (array): An array of objects representing the client's enrollment into experiments. Each enrollment object contains details about the experiment, such as the experiment ID, branch, and type.
279283

280284
Example output:

0 commit comments

Comments
 (0)