Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apify-api/openapi/components/responses/PaymentRequired.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
description: Payment required - the user has exceeded their usage limit or does not have enough credits.
description: Payment required - the user has exceeded their usage limit, does not have enough credits, or the request lacks authentication and payment credentials.
content:
application/json:
schema:
$ref: ../schemas/common/ErrorResponse.yaml
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should use allOf here to make sure that type is set to the one true allowed value

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's following the same pattern as all other responses 🤔 Should it be changed everywhere? If so, then I'd do it in a separate PR.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, in https://github.com/apify/apify-docs/blob/3b28c7aeebbb3f77c51a6a89f7fc017e7a689eac/apify-api/openapi/components/schemas/common/errors/ActorErrors.yaml, it is correct already... I thought that PR changed every error response. @vdusek can you share you opinion please?

example:
error:
type: actor-memory-limit-exceeded
message: You have exceeded your usage limit. Please consider upgrading your plan.
type: x402-payment-required
message: Please provide X402-PAYMENT-SIGNATURE header with the payment. See https://x402.org.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ properties:
- token-not-valid
- unknown-build-tag
- unsupported-content-encoding
- x402-payment-required
message:
type: string
description: Human-readable error message describing what went wrong.
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ enum:
- token-not-valid
- unknown-build-tag
- unsupported-content-encoding
- x402-payment-required
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ post:
application/json:
schema:
$ref: "../../components/schemas/common/errors/ActorErrors.yaml#/ActorRunFailedError"
"402":
$ref: ../../components/responses/PaymentRequired.yaml
"404":
description: Not found - the requested resource was not found.
content:
Expand Down
2 changes: 2 additions & 0 deletions apify-api/openapi/paths/actors/acts@{actorId}@run-sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ post:
application/json:
schema:
$ref: "../../components/schemas/common/errors/ActorErrors.yaml#/ActorRunFailedError"
"402":
$ref: ../../components/responses/PaymentRequired.yaml
"404":
description: Not found - the requested resource was not found.
content:
Expand Down