Skip to content

Commit 87ffcd1

Browse files
vdusekclaude
andcommitted
fix(openapi): remove schema-level examples from error schemas to fix codegen
datamodel-codegen interprets schema-level `example` values as type constraints, creating numbered classes (Error1, Error2, Type1, etc.) instead of reusing the shared ErrorDetail type. Remove examples from error schemas so all error responses use ErrorDetail directly, producing clean class names. Also add title: ErrorDetail to the inline error object in ErrorResponse.yaml so datamodel-codegen generates a named class instead of a numbered one. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 07e5812 commit 87ffcd1

5 files changed

Lines changed: 1 addition & 60 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ required:
44
type: object
55
properties:
66
error:
7+
title: ErrorDetail
78
type: object
89
properties:
910
type:

apify-api/openapi/components/schemas/common/errors/ActorErrors.yaml

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,67 +3,39 @@ ActorNotFoundError:
33
properties:
44
error:
55
$ref: ../ErrorDetail.yaml
6-
example:
7-
error:
8-
type: actor-not-found
9-
message: Actor was not found
106

117
ActorBuildNotFoundError:
128
type: object
139
properties:
1410
error:
1511
$ref: ../ErrorDetail.yaml
16-
example:
17-
error:
18-
type: record-not-found
19-
message: Actor build was not found
2012

2113
RecordOrTokenNotFoundError:
2214
type: object
2315
properties:
2416
error:
2517
$ref: ../ErrorDetail.yaml
26-
example:
27-
error:
28-
type: record-or-token-not-found
29-
message: Actor was not found or access denied
3018

3119
ActorRunNotFoundError:
3220
type: object
3321
properties:
3422
error:
3523
$ref: ../ErrorDetail.yaml
36-
example:
37-
error:
38-
type: record-not-found
39-
message: Actor run was not found
4024

4125
ActorRunTimeoutExceededError:
4226
type: object
4327
properties:
4428
error:
4529
$ref: ../ErrorDetail.yaml
46-
example:
47-
error:
48-
type: run-timeout-exceeded
49-
message: Actor run exceeded the timeout of 300 seconds for this API endpoint
5030

5131
ActorRunFailedError:
5232
type: object
5333
properties:
5434
error:
5535
$ref: ../ErrorDetail.yaml
56-
example:
57-
error:
58-
type: run-failed
59-
message: "Actor run did not succeed (run ID: 55uatRrZib4xbZs, status: FAILED)"
6036

6137
ActorVersionNotFoundError:
6238
type: object
6339
properties:
6440
error:
6541
$ref: ../ErrorDetail.yaml
66-
example:
67-
error:
68-
type: record-not-found
69-
message: Actor version was not found

apify-api/openapi/components/schemas/common/errors/BuildErrors.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,3 @@ UnknownBuildTagError:
33
properties:
44
error:
55
$ref: ../ErrorDetail.yaml
6-
example:
7-
error:
8-
type: unknown-build-tag
9-
message: 'Build with tag "latest" was not found. Has the Actor been built already?'

apify-api/openapi/components/schemas/common/errors/EnvVariableErrors.yaml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,3 @@ EnvironmentVariableNotFoundError:
33
properties:
44
error:
55
$ref: ../ErrorDetail.yaml
6-
example:
7-
error:
8-
type: record-not-found
9-
message: Environment variable was not found

apify-api/openapi/components/schemas/common/errors/StorageErrors.yaml

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,57 +3,33 @@ DatasetNotFoundError:
33
properties:
44
error:
55
$ref: ../ErrorDetail.yaml
6-
example:
7-
error:
8-
type: record-not-found
9-
message: Dataset was not found
106

117
KeyValueStoreNotFoundError:
128
type: object
139
properties:
1410
error:
1511
$ref: ../ErrorDetail.yaml
16-
example:
17-
error:
18-
type: record-not-found
19-
message: Key-value Store was not found
2012

2113
RequestQueueNotFoundError:
2214
type: object
2315
properties:
2416
error:
2517
$ref: ../ErrorDetail.yaml
26-
example:
27-
error:
28-
type: record-not-found
29-
message: Request Queue was not found
3018

3119
RecordNotFoundError:
3220
type: object
3321
properties:
3422
error:
3523
$ref: ../ErrorDetail.yaml
36-
example:
37-
error:
38-
type: record-not-found
39-
message: Record was not found
4024

4125
RequestNotFoundError:
4226
type: object
4327
properties:
4428
error:
4529
$ref: ../ErrorDetail.yaml
46-
example:
47-
error:
48-
type: record-not-found
49-
message: Request was not found
5030

5131
RequestIdInvalidError:
5232
type: object
5333
properties:
5434
error:
5535
$ref: ../ErrorDetail.yaml
56-
example:
57-
error:
58-
type: request-id-invalid
59-
message: Request ID does not correspond to uniqueKey

0 commit comments

Comments
 (0)