View | Details | Raw Unified | Return to bug 16825
Collapse All | Expand All

(-)a/api/v1/definitions/item.json (+4 lines)
Lines 172-177 Link Here
172
    "stocknumber": {
172
    "stocknumber": {
173
      "type": ["string", "null"],
173
      "type": ["string", "null"],
174
      "description": "inventory number"
174
      "description": "inventory number"
175
    },
176
    "new_status": {
177
      "type": ["string", "null"],
178
      "description": "'new' value, whatever free-text information."
175
    }
179
    }
176
  }
180
  }
177
}
181
}
(-)a/t/db_dependent/api/v1/items.t (-2 / +18 lines)
Lines 19-25 Link Here
19
19
20
use Modern::Perl;
20
use Modern::Perl;
21
21
22
use Test::More tests => 12;
22
use Test::More tests => 13;
23
use Test::Mojo;
23
use Test::Mojo;
24
use t::lib::TestBuilder;
24
use t::lib::TestBuilder;
25
25
Lines 34-39 use Koha::Items; Link Here
34
34
35
my $builder = t::lib::TestBuilder->new();
35
my $builder = t::lib::TestBuilder->new();
36
36
37
subtest 'Swagger item-definition and Koha::Item' => sub {
38
    plan tests => 2;
39
40
    use_ok("Swagger2");
41
    my $swagger = Swagger2->new(C4::Context->config('intranetdir')."/api/v1/swagger.json")->expand;
42
    my $api_spec = $swagger->api_spec->data;
43
44
    my $properties = $api_spec->{definitions}->{"item"}->{properties};
45
    my @columns = Koha::Item->new->_result->columns;
46
    my @missing;
47
    foreach my $column (@columns) {
48
        push @missing, $column unless $properties->{$column};
49
    }
50
51
    is(join(', ' , @missing), "", "Item definition up-to-date with Koha::Item columns.");
52
};
53
37
my $dbh = C4::Context->dbh;
54
my $dbh = C4::Context->dbh;
38
$dbh->{AutoCommit} = 0;
55
$dbh->{AutoCommit} = 0;
39
$dbh->{RaiseError} = 1;
56
$dbh->{RaiseError} = 1;
40
- 

Return to bug 16825