Project

General

Profile

Actions

Bug #11673

closed

API settings unquoted integer provided gives error

Added by Ivan Necas over 8 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Settings
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1241077
Description of problem:

Settings unqouted Integer values are resulting in an error that an integer is required. Changing it to a quoted value does not give this error.
I would expect the otherway around that a quoted integer shall give an error instead.

This is also a regression compared to 6.0.8 that accepted the unqouted integer value.

  1. curl -K /opt/hoici/etc/sat6/curl-hoici.conf "-HContent-Type: application/json" "-d{\"per_page\":9999,\"setting\":{\"value\":60}}" -XPUT https://localhost/api/v2/settings/52 {
    "error": {"id":52,"errors":{"value":["is invalid: must be integer"]},"full_messages":["Value is invalid: must be integer"]}
    }
  1. curl -K /opt/hoici/etc/sat6/curl-hoici.conf "-HContent-Type: application/json" "-d{\"per_page\":9999,\"setting\":{\"value\":\"60\"}}" -XPUT https://localhost/api/v2/settings/52 {"created_at":"2015-07-08T08:45:44Z","default":30,"description":"Puppet interval in minutes","id":52,"name":"puppet_interval","settings_type":"integer","updated_at":"2015-07-08T09:57:12Z","value":60}

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. See curl commands above
2.
3.

Actual results:
Unqouted integer value gives error

Expected results:
Unqouted integer works

Additional info:

Actions #1

Updated by The Foreman Bot over 8 years ago

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

Updated by Ivan Necas over 8 years ago

  • Status changed from Ready For Testing to Closed
Actions #3

Updated by Dominic Cleal over 8 years ago

  • Category set to Settings
  • translation missing: en.field_release set to 72
Actions

Also available in: Atom PDF