Project

General

Profile

Actions

Bug #27107

closed

pagination API expects strings while the values really should be numeric

Added by Evgeni Golov almost 5 years ago. Updated almost 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
API
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

https://theforeman.org/api/1.22/apidoc/v2/architectures/index.html (and all other Foreman objects) says:

page (optional) paginate results
Validations: Must be a String

per_page (optional) number of entries per request
Validations: Must be a String

If you compare this to Katello (https://theforeman.org/plugins/katello/3.12/api/apidoc/v2/activation_keys/index.html), you see:

page (optional) Page number, starting at 1
Validations: Must be a number.

per_page (optional) Number of results per page to return
Validations: Must be a number.

This is IMHO both more logical from the wording and the validations.

The problem with the Foreman approach is that if an API client actually looks at "expected_type" (which is "string" in Foreman and "numeric" in Katello), it will refuse to pass integers to the API.

Actions #1

Updated by The Foreman Bot almost 5 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/6857 added
Actions #2

Updated by Tomer Brisker almost 5 years ago

  • Fixed in Releases 1.23.0 added
Actions #3

Updated by Evgeni Golov almost 5 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF