Skip to content

POST to /api/groups/ID with NULL filter doesn't clear the filter #1282

@jrafanie

Description

@jrafanie
  1. GET:
    http://localhost:3000/api/groups/31/?expand=resources&attributes=description,entitlement.filters

Result:



{
  "href": "http://localhost:3000/api/groups/31",
  "description": "joe",
  "id": "31",
  "entitlement": {
    "filters": {
      "belongsto": ["/belongsto/ExtManagementSystem|VMware-infrastructure/EmsFolder|Datacenters/EmsFolder|XXX/EmsFolder|datastore"],
      "managed": [["/managed/cc/001"]]
    }
  }
}
  1. POST
    http://localhost:3000/api/groups/31/

BODY:

{
  "action" : "edit",
  "resource" : {
    "filters" : null
  }
}
  1. Do the GET in 1) again, and the filters remain

  2. If you do the POST in 2) but with an empty [] filter, see below, it will work. null does not work.

BODY:

{
  "action" : "edit",
  "resource" : {
    "filters" : {
      "belongsto": [],
      "managed": [[]]
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions