Commit 96bcb33
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
- apify-api/openapi
- components/schemas
- actor-builds
- actor-runs
- actor-tasks
- actors
- common
- datasets
- key-value-stores
- request-queues
- schedules
- store
- users
- webhook-dispatches
- webhooks
- paths
- actor-builds
- actor-runs
- actor-tasks
- actors
- datasets
- key-value-stores
- request-queues
- schedules
- store
- users
- webhook-dispatches
- webhooks
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
Lines changed: 5 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
8 | | - | |
9 | | - | |
| 7 | + | |
10 | 8 | | |
11 | | - | |
12 | | - | |
| 9 | + | |
| 10 | + | |
13 | 11 | | |
14 | 12 | | |
15 | | - | |
| 13 | + | |
| 14 | + | |
16 | 15 | | |
Lines changed: 0 additions & 7 deletions
This file was deleted.
Lines changed: 0 additions & 267 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
Lines changed: 0 additions & 32 deletions
This file was deleted.
0 commit comments