Skip to content

Commit f7f4e96

Browse files
committed
Refactor search models to use non-nullable integer types for pagination properties. Fixes issue #212
1 parent 87610cd commit f7f4e96

File tree

3 files changed

+7
-22
lines changed

3 files changed

+7
-22
lines changed

src/CompaniesHouse/Response/Search/AllSearch/AllSearch.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ public class AllSearch
1212
public SearchItem[] Items { get; set; }
1313

1414
[JsonProperty(PropertyName = "items_per_page")]
15-
public string ItemsPerPage { get; set; }
15+
public int ItemsPerPage { get; set; }
1616

1717
[JsonProperty(PropertyName = "kind")]
1818
public string Kind { get; set; }
1919

2020
[JsonProperty(PropertyName = "start_index")]
21-
public string StartIndex { get; set; }
21+
public int StartIndex { get; set; }
2222

2323
[JsonProperty(PropertyName = "total_results")]
24-
public string TotalResults { get; set; }
24+
public int TotalResults { get; set; }
2525
}
2626
}

src/CompaniesHouse/Response/Search/AllSearch/Item.cs

Lines changed: 0 additions & 15 deletions
This file was deleted.

src/CompaniesHouse/Response/Search/CompanySearch/CompanySearch.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@ public class CompanySearch
1111
public Company[] Companies { get; set; }
1212

1313
[JsonProperty(PropertyName = "items_per_page")]
14-
public int? ItemsPerPage { get; set; }
14+
public int ItemsPerPage { get; set; }
1515

1616
[JsonProperty(PropertyName = "kind")]
1717
public string Kind { get; set; }
1818

1919
[JsonProperty(PropertyName = "page_number")]
20-
public int? PageNumber { get; set; }
20+
public int PageNumber { get; set; }
2121

2222
[JsonProperty(PropertyName = "start_index")]
23-
public int? StartIndex { get; set; }
23+
public int StartIndex { get; set; }
2424

2525
[JsonProperty(PropertyName = "total_results")]
26-
public int? TotalResults { get; set; }
26+
public int TotalResults { get; set; }
2727
}
2828
}

0 commit comments

Comments
 (0)