Project

General

Profile

Bug #22964

Some numeric options are no longer recognized as numeric. Tests are failing.

Added by Martin Bacovsky over 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Difficulty:
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:

Description

With recent change in recognition of option types in hammer [1] we tightened condition for numeric types.
There are some params improperly documented in API that produce unexpected type descriptions such as

                  {
                    "name": "architecture_id",
                    "full_name": "hostgroup[architecture_id]",
                    "description": "\n\u003cp\u003eArchitecture ID\u003c/p\u003e\n",
                    "required": false,
                    "allow_nil": true,
                    "allow_blank": false,
                    "validator": "number.",
                    "expected_type": "string",
                    "metadata": null,
                    "show": true,
                    "validations": []
                  },

These are no longer recognized as a numeric options.

The source param looks like

  param :architecture_id, :number, :desc => N_('Architecture ID')

where the type :number is not valid type validator in Apipie. (correct ones are e.g. 'Integer' or 'Numeric' [2][3])

Prior this is fixed in API [4] Hammer should have either fixed the tests to reflect this new behavior or workaround the incorrectly typed params.

[1] https://github.com/theforeman/hammer-cli/pull/272
[2] https://github.com/Apipie/apipie-rails/blob/master/lib/apipie/validator.rb
[3] https://github.com/theforeman/foreman/blob/cb591e34f4e1f462b826a5f391bed20ceb192da3/config/initializers/apipie.rb#L71-L147
[4] http://projects.theforeman.org/issues/22963


Related issues

Related to Foreman - Bug #22963: Some API params are documented with wrong typeNew2018-03-21

Associated revisions

Revision ac3e0e05 (diff)
Added by Tomas Strachota over 2 years ago

Fixes #22964 - some numeric options are no longer recognized as numeric

History

#1 Updated by Martin Bacovsky over 2 years ago

  • Related to Bug #22963: Some API params are documented with wrong type added

#2 Updated by Tomáš Strachota over 2 years ago

  • Assignee set to Tomáš Strachota

#3 Updated by The Foreman Bot over 2 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/hammer-cli-foreman/pull/360 added

#4 Updated by Martin Bacovsky over 2 years ago

  • Legacy Backlogs Release (now unused) set to 350

#5 Updated by Anonymous over 2 years ago

  • % Done changed from 0 to 100
  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF