docs: expand public workbench API contract - #18
EstandarMustaq merged 1 commit into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2c296079fe
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| payload: | ||
| oneOf: | ||
| - $ref: '#/components/schemas/PaymentStartPayload' | ||
| - $ref: '#/components/schemas/PaymentSettlementPayload' | ||
| - $ref: '#/components/schemas/PaymentReconciliationPayload' |
There was a problem hiding this comment.
Tie job payload schema to the job type
For clients or gateways that validate requests from this OpenAPI contract, the payload alternatives are independent of type, so {"type":"PAYMENT_CAPTURE","payload":{}} validates via PaymentReconciliationPayload, and PAYMENT_RECONCILIATION can validate with a capture payload. Those requests are accepted by the contract but then either fail later in the worker or run the wrong handler. Model CreateJob as a oneOf of full objects with type constants and the matching payload schema, or add a discriminator mapping.
Useful? React with 👍 / 👎.
| PlatformStatus: | ||
| type: object | ||
| properties: | ||
| service: { type: string } | ||
| status: { type: string, enum: [ok, degraded, down] } | ||
| timestamp: { type: string, format: date-time } | ||
| worker: { type: object, additionalProperties: true } | ||
| dependencies: { type: object, additionalProperties: true } |
There was a problem hiding this comment.
Expose status sections in the schema
The /api/status response is now bound to PlatformStatus, but this schema omits fields that PlatformStatusService.status() always returns, including queues, schedules, version, environment, started_at, and uptime_seconds. Generated clients will treat the main queue/schedule status sections as unmodelled extras instead of part of the public contract, so the status schema should include the same fields returned by the controller.
Useful? React with 👍 / 👎.
| type: { type: string, enum: [PAYMENT_CAPTURE, PAYMENT_DISBURSEMENT, PAYMENT_SETTLEMENT, PAYMENT_RECONCILIATION] } | ||
| queue: { type: string, const: payments, default: payments } |
There was a problem hiding this comment.
Keep accepted job types in the contract
When an authenticated caller submits the existing non-payment jobs through /api/jobs (for example queue: "platform" with type: "LEDGER_CORE_EVENT"), JobsController.validateCreateJob() still accepts them because it checks against the full JOB_TYPES list. The new contract narrows the endpoint to payment types and the payments queue, so generated clients or request validators will reject requests that the API still supports; either document the full accepted set or make the controller reject non-payment submissions.
Useful? React with 👍 / 👎.
5ab0344
into
rfc-0002-legacy-batch-orchestration
* feat: orchestrate legacy batch processing * docs: expand public workbench API contract (#18)
* feat: secure worker runtime with OIDC * RFC-0002: reject cross-tenant domain jobs (#15) * fix: reject cross-tenant domain jobs * RFC-0002: publish workbench public API contract (#16) * feat: publish versioned public api contract * RFC-0002: orchestrate legacy batch processing (#17) * feat: orchestrate legacy batch processing * docs: expand public workbench API contract (#18)
Summary
Validation