From cd4e73f589a5823ceb1618faf1708baee08855e6 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Wed, 20 Dec 2023 14:47:08 +0000 Subject: [PATCH] Bug 35616: API specification update Signed-off-by: David Nind --- api/v1/swagger/definitions/ticket.yaml | 5 +++++ t/db_dependent/api/v1/tickets.t | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/api/v1/swagger/definitions/ticket.yaml b/api/v1/swagger/definitions/ticket.yaml index 57e4cfd54d..5ca2671cbb 100644 --- a/api/v1/swagger/definitions/ticket.yaml +++ b/api/v1/swagger/definitions/ticket.yaml @@ -5,6 +5,10 @@ properties: type: integer description: Internal ticket identifier readOnly: true + source: + type: string + enum: + - catalog reported_date: type: - string @@ -60,5 +64,6 @@ properties: description: Number of updates additionalProperties: false required: + - source - title - body diff --git a/t/db_dependent/api/v1/tickets.t b/t/db_dependent/api/v1/tickets.t index 788d32a252..9cfebde702 100755 --- a/t/db_dependent/api/v1/tickets.t +++ b/t/db_dependent/api/v1/tickets.t @@ -172,6 +172,7 @@ subtest 'add() tests' => sub { my $biblio = $builder->build_sample_biblio(); my $ticket = { + source => 'catalog', biblio_id => $biblio->id, title => "Test ticket", body => "Test ticket details", @@ -185,6 +186,7 @@ subtest 'add() tests' => sub { # Authorized attempt to write invalid data my $ticket_with_invalid_field = { blah => "Something wrong", + source => 'catalog', biblio_id => $biblio->id, title => "Test ticket", body => "Test ticket details", @@ -230,6 +232,7 @@ subtest 'add() tests' => sub { # Authorized attempt to write missing data my $ticket_with_missing_field = { + source => 'catalog', biblio_id => $biblio->id, body => "Test ticket details", }; @@ -282,6 +285,7 @@ subtest 'update() tests' => sub { # Attempt partial update on a PUT my $ticket_with_missing_field = { + source => 'catalog', body => "Test ticket details", }; @@ -292,6 +296,7 @@ subtest 'update() tests' => sub { # Full object update on PUT my $ticket_with_updated_field = { + source => 'catalog', title => "Test ticket update", body => "Test ticket update details", }; @@ -303,6 +308,7 @@ subtest 'update() tests' => sub { # Authorized attempt to write invalid data my $ticket_with_invalid_field = { blah => "Ticket Blah", + source => 'catalog', title => "Test ticket update", body => "Test ticket update details", }; -- 2.30.2