JobsetInputs: update schema to align with the API

`PUT /jobsets/{project-id}/{jobset-id}` expects a JSON object `inputs` which
maps a name to a name, a type, a value, and a boolean that enables emailing
responsible parties. However, `GET /jobsets/{project-id}/{jobset-id}` responds
with an object that doesn't contain a value, but does contain a jobsetinputalts
(which is old and should be unused).

This commit aligns the two by removing the old and unused `jobsetinputalts` from
the response and replaces it with `value`.
This commit is contained in:
Cole Helbling 2021-04-28 12:32:44 -07:00 committed by Graham Christensen
parent fff0db10e3
commit d23f431889
2 changed files with 18 additions and 19 deletions

View file

@ -589,17 +589,15 @@ components:
name: name:
description: name of the input description: name of the input
type: string type: string
value:
description: value of the input
type: string
type: type:
description: type of input description: type of input
type: string type: string
emailresponsible: emailresponsible:
description: whether or not to email responsible parties description: whether or not to email responsible parties
type: boolean type: boolean
jobsetinputalts:
type: array
description: ???
items:
type: string
Jobset: Jobset:
type: object type: object

View file

@ -134,21 +134,22 @@ __PACKAGE__->has_many(
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-06 12:22:36 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-02-06 12:22:36
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:5uKwEhDXso4IR1TFmwRxiA # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:5uKwEhDXso4IR1TFmwRxiA
my %hint = ( sub as_json {
string_columns => [ my $self = shift;
"name",
"type"
],
boolean_columns => [
"emailresponsible"
],
relations => {
"jobsetinputalts" => "value"
}
);
sub json_hint { my ($input) = $self->jobsetinputalts;
return \%hint;
my %json = (
# string_columns
"name" => $self->get_column("name") // "",
"type" => $self->get_column("type") // "",
"value" => $input->value // "",
# boolean_columns
"emailresponsible" => $self->get_column("emailresponsible") ? JSON::true : JSON::false,
);
return \%json;
} }
1; 1;