Skip to content

Commit fa69302

Browse files
authored
docs(openapi): Use more autogenerated response examples (#2306)
## Summary - Delete some explicit examples and use auto-generated examples from the schema. - Keep explicit examples where it helps: - lists, where an autogenerated example would contain just one item - specific non-default values. For example, aborted runs will have some specific run status, so returning an autogenerated example run could be confusing ## Motivation - Remove massive code duplication - Preparation for adding undocumented redispatch endpoints, which would otherwise have to repeat the examples again, making the duplication even worse. - Manual examples are missing newly added optional fields **Example:** <img width="2095" height="946" alt="image" src="https://github.com/user-attachments/assets/7251af52-3d0e-4299-abbe-64e04dc3bf74" /> <!-- CURSOR_SUMMARY --> --- > [!NOTE] > <sup>[Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) is generating a summary for commit 2fe84fe. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent a177987 commit fa69302

21 files changed

+45
-1155
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
value:
2+
data:
3+
total: 2
4+
offset: 0
5+
limit: 1000
6+
desc: false
7+
count: 2
8+
items:
9+
- id: HG7ML7M8z78YcAPEB
10+
actId: HDSasDasz78YcAPEB
11+
actorTaskId: KJHSKHausidyaJKHs
12+
status: SUCCEEDED
13+
startedAt: "2019-11-30T07:34:24.202Z"
14+
finishedAt: "2019-12-12T09:30:12.202Z"
15+
buildId: HG7ML7M8z78YcAPEB
16+
buildNumber: 0.0.2
17+
meta:
18+
origin: WEB
19+
usageTotalUsd: 0.2
20+
defaultKeyValueStoreId: sfAjeR4QmeJCQzTfe
21+
defaultDatasetId: 3ZojQDdFTsyE7Moy4
22+
defaultRequestQueueId: so93g2shcDzK3pA85
23+
- id: HG7ML7M8z78YcAPEB
24+
actId: HDSasDasz78YcAPEB
25+
actorTaskId: KJHSKHausidyaJKHs
26+
status: FAILED
27+
startedAt: "2019-12-12T07:34:14.202Z"
28+
finishedAt: "2019-12-13T08:36:13.202Z"
29+
buildId: u78dML7M8z78YcAPEB
30+
buildNumber: 0.2.2
31+
meta:
32+
origin: DEVELOPMENT
33+
usageTotalUsd: 0.6
34+
defaultKeyValueStoreId: sffsouqlseJCQzTfe
35+
defaultDatasetId: CFGggdjQDsyE7Moyw
36+
defaultRequestQueueId: soowucklrmDzKpA8x

apify-api/openapi/paths/actor-runs/actor-runs.yaml

Lines changed: 3 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -90,42 +90,9 @@ get:
9090
schema:
9191
allOf:
9292
- $ref: ../../components/schemas/actor-runs/ListOfRunsResponse.yaml
93-
example:
94-
data:
95-
total: 2
96-
offset: 0
97-
limit: 1000
98-
desc: false
99-
count: 2
100-
items:
101-
- id: HG7ML7M8z78YcAPEB
102-
actId: HDSasDasz78YcAPEB
103-
actorTaskId: KJHSKHausidyaJKHs
104-
status: SUCCEEDED
105-
startedAt: "2019-11-30T07:34:24.202Z"
106-
finishedAt: "2019-12-12T09:30:12.202Z"
107-
buildId: HG7ML7M8z78YcAPEB
108-
buildNumber: 0.0.2
109-
meta:
110-
origin: WEB
111-
usageTotalUsd: 0.2
112-
defaultKeyValueStoreId: sfAjeR4QmeJCQzTfe
113-
defaultDatasetId: 3ZojQDdFTsyE7Moy4
114-
defaultRequestQueueId: so93g2shcDzK3pA85
115-
- id: HG7ML7M8z78YcAPEB
116-
actId: HDSasDasz78YcAPEB
117-
actorTaskId: KJHSKHausidyaJKHs
118-
status: FAILED
119-
startedAt: "2019-12-12T07:34:14.202Z"
120-
finishedAt: "2019-12-13T08:36:13.202Z"
121-
buildId: u78dML7M8z78YcAPEB
122-
buildNumber: 0.2.2
123-
meta:
124-
origin: DEVELOPMENT
125-
usageTotalUsd: 0.6
126-
defaultKeyValueStoreId: sffsouqlseJCQzTfe
127-
defaultDatasetId: CFGggdjQDsyE7Moyw
128-
defaultRequestQueueId: soowucklrmDzKpA8x
93+
examples:
94+
example:
95+
$ref: ../../components/examples/ListOfRunsResponseExample.yaml
12996
"400":
13097
$ref: ../../components/responses/BadRequest.yaml
13198
deprecated: false

apify-api/openapi/paths/actor-runs/actor-runs@{runId}.yaml

Lines changed: 0 additions & 148 deletions
Original file line numberDiff line numberDiff line change
@@ -105,80 +105,6 @@ get:
105105
schema:
106106
allOf:
107107
- $ref: ../../components/schemas/actor-runs/RunResponse.yaml
108-
example:
109-
data:
110-
id: HG7ML7M8z78YcAPEB
111-
actId: HDSasDasz78YcAPEB
112-
userId: 7sT5jcggjjA9fNcxF
113-
actorTaskId: KJHSKHausidyaJKHs
114-
startedAt: "2019-11-30T07:34:24.202Z"
115-
finishedAt: "2019-12-12T09:30:12.202Z"
116-
status: RUNNING
117-
statusMessage: Actor is running
118-
isStatusMessageTerminal: false
119-
meta:
120-
origin: WEB
121-
clientIp: 172.234.12.34
122-
userAgent: Mozilla/5.0 (iPad)
123-
stats:
124-
inputBodyLen: 240
125-
migrationCount: 0
126-
restartCount: 0
127-
resurrectCount: 2
128-
memAvgBytes: 267874071.9
129-
memMaxBytes: 404713472
130-
memCurrentBytes: 0
131-
cpuAvgUsage: 33.75321011075384
132-
cpuMaxUsage: 169.65073553494125
133-
cpuCurrentUsage: 0
134-
netRxBytes: 103508042
135-
netTxBytes: 4854600
136-
durationMillis: 248472
137-
runTimeSecs: 248.472
138-
metamorph: 0
139-
computeUnits: 0.13804
140-
options:
141-
build: latest
142-
timeoutSecs: 300
143-
memoryMbytes: 1024
144-
diskMbytes: 2048
145-
buildId: 7sT5jcggjjA9fNcxF
146-
exitCode: 0
147-
generalAccess: RESTRICTED
148-
defaultKeyValueStoreId: eJNzqsbPiopwJcgGQ
149-
defaultDatasetId: wmKPijuyDnPZAPRMk
150-
defaultRequestQueueId: FL35cSF7jrxr3BY39
151-
buildNumber: 0.0.36
152-
containerUrl: "https://g8kd8kbc5ge8.runs.apify.net"
153-
isContainerServerReady: true
154-
gitBranchName: master
155-
usage:
156-
ACTOR_COMPUTE_UNITS: 3
157-
DATASET_READS: 4
158-
DATASET_WRITES: 4
159-
KEY_VALUE_STORE_READS: 5
160-
KEY_VALUE_STORE_WRITES: 3
161-
KEY_VALUE_STORE_LISTS: 5
162-
REQUEST_QUEUE_READS: 2
163-
REQUEST_QUEUE_WRITES: 1
164-
DATA_TRANSFER_INTERNAL_GBYTES: 1
165-
DATA_TRANSFER_EXTERNAL_GBYTES: 3
166-
PROXY_RESIDENTIAL_TRANSFER_GBYTES: 34
167-
PROXY_SERPS: 3
168-
usageTotalUsd: 0.2654
169-
usageUsd:
170-
ACTOR_COMPUTE_UNITS: 0.072
171-
DATASET_READS: 0.0004
172-
DATASET_WRITES: 0.0002
173-
KEY_VALUE_STORE_READS: 0.0006
174-
KEY_VALUE_STORE_WRITES: 0.002
175-
KEY_VALUE_STORE_LISTS: 0.004
176-
REQUEST_QUEUE_READS: 0.005
177-
REQUEST_QUEUE_WRITES: 0.02
178-
DATA_TRANSFER_INTERNAL_GBYTES: 0.0004
179-
DATA_TRANSFER_EXTERNAL_GBYTES: 0.0002
180-
PROXY_RESIDENTIAL_TRANSFER_GBYTES: 0.16
181-
PROXY_SERPS: 0.0006
182108
"400":
183109
$ref: ../../components/responses/BadRequest.yaml
184110
deprecated: false
@@ -249,80 +175,6 @@ put:
249175
application/json:
250176
schema:
251177
$ref: ../../components/schemas/actor-runs/RunResponse.yaml
252-
example:
253-
data:
254-
id: HG7ML7M8z78YcAPEB
255-
actId: HDSasDasz78YcAPEB
256-
userId: 7sT5jcggjjA9fNcxF
257-
actorTaskId: KJHSKHausidyaJKHs
258-
startedAt: "2019-11-30T07:34:24.202Z"
259-
finishedAt: "2019-12-12T09:30:12.202Z"
260-
status: RUNNING
261-
statusMessage: Actor is running
262-
isStatusMessageTerminal: false
263-
meta:
264-
origin: WEB
265-
clientIp: 172.234.12.34
266-
userAgent: Mozilla/5.0 (iPad)
267-
stats:
268-
inputBodyLen: 240
269-
migrationCount: 0
270-
restartCount: 0
271-
resurrectCount: 2
272-
memAvgBytes: 267874071.9
273-
memMaxBytes: 404713472
274-
memCurrentBytes: 0
275-
cpuAvgUsage: 33.75321011075384
276-
cpuMaxUsage: 169.65073553494125
277-
cpuCurrentUsage: 0
278-
netRxBytes: 103508042
279-
netTxBytes: 4854600
280-
durationMillis: 248472
281-
runTimeSecs: 248.472
282-
metamorph: 0
283-
computeUnits: 0.13804
284-
options:
285-
build: latest
286-
timeoutSecs: 300
287-
memoryMbytes: 1024
288-
diskMbytes: 2048
289-
buildId: 7sT5jcggjjA9fNcxF
290-
exitCode: 0
291-
generalAccess: RESTRICTED
292-
defaultKeyValueStoreId: eJNzqsbPiopwJcgGQ
293-
defaultDatasetId: wmKPijuyDnPZAPRMk
294-
defaultRequestQueueId: FL35cSF7jrxr3BY39
295-
buildNumber: 0.0.36
296-
containerUrl: "https://g8kd8kbc5ge8.runs.apify.net"
297-
isContainerServerReady: true
298-
gitBranchName: master
299-
usage:
300-
ACTOR_COMPUTE_UNITS: 3
301-
DATASET_READS: 4
302-
DATASET_WRITES: 4
303-
KEY_VALUE_STORE_READS: 5
304-
KEY_VALUE_STORE_WRITES: 3
305-
KEY_VALUE_STORE_LISTS: 5
306-
REQUEST_QUEUE_READS: 2
307-
REQUEST_QUEUE_WRITES: 1
308-
DATA_TRANSFER_INTERNAL_GBYTES: 1
309-
DATA_TRANSFER_EXTERNAL_GBYTES: 3
310-
PROXY_RESIDENTIAL_TRANSFER_GBYTES: 34
311-
PROXY_SERPS: 3
312-
usageTotalUsd: 0.2654
313-
usageUsd:
314-
ACTOR_COMPUTE_UNITS: 0.072
315-
DATASET_READS: 0.0004
316-
DATASET_WRITES: 0.0002
317-
KEY_VALUE_STORE_READS: 0.0006
318-
KEY_VALUE_STORE_WRITES: 0.002
319-
KEY_VALUE_STORE_LISTS: 0.004
320-
REQUEST_QUEUE_READS: 0.005
321-
REQUEST_QUEUE_WRITES: 0.02
322-
DATA_TRANSFER_INTERNAL_GBYTES: 0.0004
323-
DATA_TRANSFER_EXTERNAL_GBYTES: 0.0002
324-
PROXY_RESIDENTIAL_TRANSFER_GBYTES: 0.16
325-
PROXY_SERPS: 0.0006
326178
"400":
327179
$ref: ../../components/responses/BadRequest.yaml
328180
deprecated: false

apify-api/openapi/paths/actor-runs/actor-runs@{runId}@metamorph.yaml

Lines changed: 0 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -59,84 +59,6 @@ post:
5959
application/json:
6060
schema:
6161
$ref: ../../components/schemas/actor-runs/RunResponse.yaml
62-
example:
63-
data:
64-
id: HG7ML7M8z78YcAPEB
65-
actId: janedoe~my-actor
66-
userId: PNWZBd7Z9c746JAnF
67-
startedAt: "2019-11-30T07:34:24.202Z"
68-
finishedAt: null
69-
status: RUNNING
70-
statusMessage: Actor is running
71-
isStatusMessageTerminal: false
72-
meta:
73-
origin: WEB
74-
clientIp: 172.234.12.34
75-
userAgent: Mozilla/5.0 (iPad)
76-
stats:
77-
inputBodyLen: 240
78-
migrationCount: 0
79-
restartCount: 0
80-
resurrectCount: 1
81-
memAvgBytes: 35914228.4
82-
memMaxBytes: 38244352
83-
memCurrentBytes: 0
84-
cpuAvgUsage: 0.00955965
85-
cpuMaxUsage: 3.1546
86-
cpuCurrentUsage: 0
87-
netRxBytes: 2652
88-
netTxBytes: 1338
89-
durationMillis: 26239
90-
runTimeSecs: 26.239
91-
metamorph: 0
92-
computeUnits: 0.0072886
93-
options:
94-
build: latest
95-
timeoutSecs: 300
96-
memoryMbytes: 1024
97-
diskMbytes: 2048
98-
buildId: HG7ML7M8z78YcAPEB
99-
exitCode: 0
100-
generalAccess: RESTRICTED
101-
defaultKeyValueStoreId: eJNzqsbPiopwJcgGQ
102-
defaultDatasetId: wmKPijuyDnPZAPRMk
103-
defaultRequestQueueId: FL35cSF7jrxr3BY39
104-
metamorphs:
105-
- createdAt: "2019-11-30T07:39:24.202Z"
106-
actorId: nspoEjklmnsF2oosD
107-
buildId: ME6oKecqy5kXDS4KQ
108-
inputKey: INPUT-METAMORPH-1
109-
buildNumber: 0.1.10
110-
containerUrl: "https://hfewsyknno9o.runs.apify.com"
111-
isContainerServerReady: false
112-
gitBranchName: master
113-
usage:
114-
ACTOR_COMPUTE_UNITS: 3
115-
DATASET_READS: 4
116-
DATASET_WRITES: 4
117-
KEY_VALUE_STORE_READS: 5
118-
KEY_VALUE_STORE_WRITES: 3
119-
KEY_VALUE_STORE_LISTS: 5
120-
REQUEST_QUEUE_READS: 2
121-
REQUEST_QUEUE_WRITES: 1
122-
DATA_TRANSFER_INTERNAL_GBYTES: 1
123-
DATA_TRANSFER_EXTERNAL_GBYTES: 3
124-
PROXY_RESIDENTIAL_TRANSFER_GBYTES: 34
125-
PROXY_SERPS: 3
126-
usageTotalUsd: 0.2654
127-
usageUsd:
128-
ACTOR_COMPUTE_UNITS: 0.072
129-
DATASET_READS: 0.0004
130-
DATASET_WRITES: 0.0002
131-
KEY_VALUE_STORE_READS: 0.0006
132-
KEY_VALUE_STORE_WRITES: 0.002
133-
KEY_VALUE_STORE_LISTS: 0.004
134-
REQUEST_QUEUE_READS: 0.005
135-
REQUEST_QUEUE_WRITES: 0.02
136-
DATA_TRANSFER_INTERNAL_GBYTES: 0.0004
137-
DATA_TRANSFER_EXTERNAL_GBYTES: 0.0002
138-
PROXY_RESIDENTIAL_TRANSFER_GBYTES: 0.16
139-
PROXY_SERPS: 0.0006
14062
"400":
14163
$ref: ../../components/responses/BadRequest.yaml
14264
deprecated: false

0 commit comments

Comments
 (0)