Project

General

Profile

Actions

Bug #13670

closed

SQL error when PUTing a numeric id to /api/v2/hosts/:id for any *_id attributes

Added by Walden Raines almost 9 years ago. Updated over 6 years ago.

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

Description

JSON provided:

{
    "architecture_id": 1
}

Response:

{
  "error": {
    "message": "ERROR:  operator does not exist: character varying = integer\nLINE 1: ...architectures\".\"id\" = 1 OR \"architectures\".\"name\" = 1))  ORD...\n                                                             ^\nHINT:  No operator matches the given name and argument type(s). You might need to add explicit type casts.\n" 
  }
}

Ultimately, one should be able to provide the exact same JSON received from a GET on /api/v2/hosts/:id back as a PUT without errors.

Actions

Also available in: Atom PDF