Skip to content

Commit ce24adf

Browse files
vdusekclaude
andauthored
fix(openapi): Deduplicate error schemas and fix titles for codegen compatibility (#2398)
## Summary - Extract reusable `ErrorDetail` schema referenced by all error responses (eliminates 14 duplicate inline error objects) - Fix 6 schema titles that didn't match component names (broke `use_title_as_name` codegen) - Use `const` instead of single-value `enum` in schedule action type fields - Add titles to inline schemas in `RequestDraftDelete`, `DeletedRequest`, and `DecodeAndVerifyResponse` - Also see the apify/apify-client-python#704 --------- Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c699a71 commit ce24adf

37 files changed

+378
-287
lines changed

.github/workflows/openapi-ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ jobs:
149149
GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
150150
PR_NUMBER: ${{ github.event.pull_request.number }}
151151
run: |
152-
gh workflow run regenerate_models.yaml \
152+
gh workflow run manual_regenerate_models.yaml \
153153
--repo apify/apify-client-python \
154154
--field docs_pr_number="$PR_NUMBER" \
155155
--field docs_workflow_run_id="${{ github.run_id }}"
@@ -169,7 +169,7 @@ jobs:
169169
env:
170170
GITHUB_TOKEN: ${{ secrets.APIFY_SERVICE_ACCOUNT_GITHUB_TOKEN }}
171171
PR_NUMBER: ${{ github.event.pull_request.number }}
172-
# Branch name convention must match what regenerate_models.yaml creates.
172+
# Branch name convention must match what manual_regenerate_models.yaml creates.
173173
run: |
174174
BRANCH="update-models-docs-pr-${PR_NUMBER}"
175175
EXISTING_PR=$(gh pr list \

apify-api/openapi/components/schemas/actor-tasks/CreateTaskRequest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ properties:
1212
examples: [my-task]
1313
options:
1414
anyOf:
15-
- $ref: ../common/OptionalRunOptions.yaml
15+
- $ref: ../common/TaskOptions.yaml
1616
- type: "null"
1717
input:
1818
anyOf:

apify-api/openapi/components/schemas/actor-tasks/Task.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ properties:
4040
- type: "null"
4141
options:
4242
anyOf:
43-
- $ref: ../common/OptionalRunOptions.yaml
43+
- $ref: ../common/TaskOptions.yaml
4444
- type: "null"
4545
input:
4646
anyOf:

apify-api/openapi/components/schemas/actor-tasks/UpdateTaskRequest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ properties:
66
examples: [my-task]
77
options:
88
anyOf:
9-
- $ref: ../common/OptionalRunOptions.yaml
9+
- $ref: ../common/TaskOptions.yaml
1010
- type: "null"
1111
input:
1212
anyOf:

apify-api/openapi/components/schemas/actors/DefaultRunOptions.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
title: defaultRunOptions
1+
title: DefaultRunOptions
22
type: object
33
properties:
44
build:

apify-api/openapi/components/schemas/actors/EnvVarResponse.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
title: CreateEnvironmentVariableResponse
1+
title: EnvVarResponse
22
required:
33
- data
44
type: object

apify-api/openapi/components/schemas/actors/ExampleRunInput.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
title: exampleRunInput
1+
title: ExampleRunInput
22
type: object
33
properties:
44
body:

apify-api/openapi/components/schemas/actors/UpdateActorRequest.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
title: ActUpdate
1+
title: UpdateActorRequest
22
type: object
33
properties:
44
name:
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
title: ErrorDetail
2+
type: object
3+
properties:
4+
type:
5+
$ref: ErrorType.yaml
6+
message:
7+
type: string
8+
description: Human-readable error message describing what went wrong.

apify-api/openapi/components/schemas/common/ErrorResponse.yaml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,30 @@ required:
44
type: object
55
properties:
66
error:
7+
title: ErrorDetail
78
type: object
8-
required:
9-
- type
10-
- message
119
properties:
1210
type:
11+
title: ErrorType
1312
type: string
14-
examples: [run-failed]
13+
description: Machine-processable error type identifier.
14+
enum:
15+
- actor-memory-limit-exceeded
16+
- actor-not-found
17+
- invalid-input
18+
- method-not-allowed
19+
- permission-denied
20+
- rate-limit-exceeded
21+
- record-not-found
22+
- record-not-unique
23+
- record-or-token-not-found
24+
- request-id-invalid
25+
- request-too-large
26+
- run-failed
27+
- run-timeout-exceeded
28+
- token-not-valid
29+
- unknown-build-tag
30+
- unsupported-content-encoding
1531
message:
1632
type: string
17-
examples:
18-
- "Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)"
33+
description: Human-readable error message describing what went wrong.

0 commit comments

Comments
 (0)