← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1521607] [NEW] v2 - replacing array elements with PATCH results in 400 error

 

Public bug reported:

I have the following image:

{
    "status": "active",
    "name": "foo",
    "tags": [
        "1",
        "3",
        "2"
    ],
    "container_format": "ami",
    "created_at": "2015-11-12T14:26:08Z",
    "size": 983040,
    "disk_format": "ami",
    "updated_at": "2015-12-01T12:25:42Z",
    "visibility": "public",
    "self": "/v2/images/386f0425-3ee8-4688-b73f-272328fe4c71",
    "min_disk": 20,
    "protected": false,
    "id": "386f0425-3ee8-4688-b73f-272328fe4c71",
    "architecture": "x86_64",
    "file": "/v2/images/386f0425-3ee8-4688-b73f-272328fe4c71/file",
    "checksum": "061d01418b94d4743a98ee26d941e87c",
    "owner": "057aad9fa85b4e29b23e7888000446ef",
    "virtual_size": null,
    "min_ram": 0,
    "schema": "/v2/schemas/image"
}

When I send this PATCH request to update it:

[{"op":"replace","path":"/tags/0","value":"10"}]

I get back the following 400 error:

"""
<html>
 <head>
  <title>400 Bad Request</title>
 </head>
 <body>
  <h1>400 Bad Request</h1>
  Invalid JSON pointer for this resource: '/tags/0'<br /><br />


 </body>
</html>
"""

"/tags/0" is a correct pointer, however, which should be supported in a
"replace" op. Why doesn't it work?

** Affects: glance
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1521607

Title:
  v2 - replacing array elements with PATCH results in 400 error

Status in Glance:
  New

Bug description:
  I have the following image:

  {
      "status": "active",
      "name": "foo",
      "tags": [
          "1",
          "3",
          "2"
      ],
      "container_format": "ami",
      "created_at": "2015-11-12T14:26:08Z",
      "size": 983040,
      "disk_format": "ami",
      "updated_at": "2015-12-01T12:25:42Z",
      "visibility": "public",
      "self": "/v2/images/386f0425-3ee8-4688-b73f-272328fe4c71",
      "min_disk": 20,
      "protected": false,
      "id": "386f0425-3ee8-4688-b73f-272328fe4c71",
      "architecture": "x86_64",
      "file": "/v2/images/386f0425-3ee8-4688-b73f-272328fe4c71/file",
      "checksum": "061d01418b94d4743a98ee26d941e87c",
      "owner": "057aad9fa85b4e29b23e7888000446ef",
      "virtual_size": null,
      "min_ram": 0,
      "schema": "/v2/schemas/image"
  }

  When I send this PATCH request to update it:

  [{"op":"replace","path":"/tags/0","value":"10"}]

  I get back the following 400 error:

  """
  <html>
   <head>
    <title>400 Bad Request</title>
   </head>
   <body>
    <h1>400 Bad Request</h1>
    Invalid JSON pointer for this resource: '/tags/0'<br /><br />


   </body>
  </html>
  """

  "/tags/0" is a correct pointer, however, which should be supported in
  a "replace" op. Why doesn't it work?

To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1521607/+subscriptions