From 35ee54c723ddace37c6c70eaaf895e6e0010ffb1 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Tue, 29 Apr 2025 07:52:41 -0300 Subject: [PATCH] Bug 39771: Make `data` attribute nullable for jobs This patch makes the `data` attribute nullable. This happens when `$job->finish()` is called with no parameters. To test: 1. Apply the regression tests patch 2. Run: $ ktd --shell k$ prove t/db_dependent/api/v1/jobs.t => FAIL: Tests don't pass, a 500 is returned when `finish()` was called with no data 3. Apply this patch 4. Rebuild the API spec: k$ yarn api:bundle 5. Repeat 2 => SUCCESS: Tests pass! The API doesn't explode 6. Sign off :-D Signed-off-by: Tomas Cohen Arazi --- api/v1/swagger/definitions/job.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/v1/swagger/definitions/job.yaml b/api/v1/swagger/definitions/job.yaml index 966e3a3ef84..7bac1f137fd 100644 --- a/api/v1/swagger/definitions/job.yaml +++ b/api/v1/swagger/definitions/job.yaml @@ -31,7 +31,9 @@ properties: type: string data: description: job data - type: object + type: + - object + - "null" context: description: job context type: object -- 2.49.0