v2 - replacing array elements with PATCH results in 400 error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
In Progress
|
Medium
|
Dharini Chandrasekar |
Bug Description
I have the following image:
{
"status": "active",
"name": "foo",
"tags": [
"1",
"3",
"2"
],
"container_
"created_at": "2015-11-
"size": 983040,
"disk_format": "ami",
"updated_at": "2015-12-
"visibility": "public",
"self": "/v2/images/
"min_disk": 20,
"protected": false,
"id": "386f0425-
"architecture": "x86_64",
"file": "/v2/images/
"checksum": "061d01418b94d4
"owner": "057aad9fa85b4e
"virtual_size": null,
"min_ram": 0,
"schema": "/v2/schemas/image"
}
When I send this PATCH request to update it:
[{"op":
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?
Changed in glance: | |
status: | New → Triaged |
importance: | Undecided → Medium |
Changed in glance: | |
assignee: | nobody → Dharini Chandrasekar (dharini-chandrasekar) |
This is what works for me:
[{"path": "/tags", "value": ["test"], "op": "replace"}]