Skip to content

Commit 96bcb33

Browse files
vdusekclaude
andauthored
fix(openapi): Standardize OpenAPI schemas and fix API response types (#2212)
## Summary This PR refactors and fixes the OpenAPI specifications to better reflect actual API responses and to follow consistent naming conventions, primarily to improve the quality of generated client models. ## Issue Closes: #2182 I consider this to be a last update from my side (at least for now). ## Key changes ### Schema naming standardization - Rename response schemas to consistent patterns: `GetXResponse` / `CreateXResponse` → `XResponse`. - Rename list schemas: `XList` → `ListOfX`, `GetXListResponse →`ListOfXResponse`. - This results in clearer, reusable models and avoids duplicate schemas with different names. ### Type fixes - Add missing enums: `WebhookDispatchStatus`, `ScheduleActionType`, `RunOrigin` (for `BuildsMeta.origin`) - Add `ANYONE_WITH_NAME_CAN_READ` value to `GeneralAccessEnum` - Add `ACTOR.STANDBY` to `WebhookEventType` - Update usage schemas to use the `additionalProperties` pattern for dynamic keys ### Schema cleanup - Remove duplicate schemas (e.g., `PostAbortBuildResponse`, `BuildActorResponse`) - Remove placeholder fields (e.g. `foo`) - Use `PaginationResponse` base for list schemas consistently - Remove enum constraint from `SourceCodeFolder.folder` ### API response fixes - Remove required constraints from optional API fields - Fix schema to match actual API response (e.g. `WebhookDispatch`, `WebhookEventType`, ...) - Add missing schemas (e.g. `ListOfTasks`, `ListOfTasksResponse`, ...) ## Questions A few questions for the Platform team (a full review would be greatly appreciated): - What is `GetOpenApiResponse.yaml` supposed to represent? - It appears to be a meta-schema attempting to describe the full OpenAPI 3.x document structure, which causes code generators to produce many unnecessary intermediate classes. - The field `DATA_TRANSFER_EXTERNAL_GBYTES?` includes a question mark, is that intentional? - Is `ActorDefinition.default_memory_mbytes` intentionally defined as `int` or `str`? - Is `WebhookDispatchList.data` intentionally optional? It seems to be the only optional `data` field. - Please verify `WebhookDispatchStatus`; it is based only on observed API responses in tests. - Is `WebhookEventType` now correct with the `TEST` value? Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 04635c1 commit 96bcb33

138 files changed

Lines changed: 339 additions & 826 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apify-api/openapi/components/schemas/actor-builds/GetBuildResponse.yaml renamed to apify-api/openapi/components/schemas/actor-builds/BuildResponse.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
title: GetBuildResponse
1+
title: BuildResponse
2+
description: Response containing Actor build data.
23
required:
34
- data
45
type: object
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
title: BuildsMeta
22
required:
33
- origin
4-
- userAgent
54
type: object
65
properties:
76
origin:
8-
type: string
9-
examples: [WEB]
7+
$ref: ../actor-runs/RunOrigin.yaml
108
clientIp:
11-
type: string
12-
format: ipv4
9+
type: [string]
10+
description: IP address of the client that started the build.
1311
examples: [172.234.12.34]
1412
userAgent:
15-
type: string
13+
type: [string]
14+
description: User agent of the client that started the build.
1615
examples: [Mozilla/5.0 (iPad)]

apify-api/openapi/components/schemas/actor-builds/GetBuildListResponse.yaml

Lines changed: 0 additions & 7 deletions
This file was deleted.

apify-api/openapi/components/schemas/actor-builds/GetOpenApiResponse.yaml

Lines changed: 0 additions & 267 deletions
This file was deleted.

apify-api/openapi/components/schemas/actor-builds/BuildList.yaml renamed to apify-api/openapi/components/schemas/actor-builds/ListOfBuilds.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
title: BuildList
1+
title: ListOfBuilds
22
allOf:
33
- $ref: ../common/PaginationResponse.yaml
44
- type: object
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
title: ListOfBuildsResponse
2+
type: object
3+
required:
4+
- data
5+
properties:
6+
data:
7+
$ref: ./ListOfBuilds.yaml

apify-api/openapi/components/schemas/actor-builds/PostAbortBuildResponse.yaml

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)