Red Hat Bugzilla – Bug 976813
submitting a resource with links in body fails to parse
Last modified: 2015-11-01 19:43:20 EST
Description of problem: Our REST api has a little inconvenience. We add 'links' to response bodies (for example resource, alert def and almost everything else). This is good. But if a client wants to send such body back, server does not accept such object (with 'links' key)
This is inconvenient for clients, because they have to "clean up" a body from links
Version-Release number of selected component (if applicable):
How reproducible: always
Consider auto-import discovery queue script:
resources = requests.get(endpoint+'resource?status=NEW').json()
for res in resources:
res['status'] = 'committed'
req = requests.put(endpoint+'resource/%d' % res['resourceId'],data=json.dumps(res))
Actual results: this code does not work, because in $res body are links, server refuses such resource.
Expected results: server should ignore links (or maybe any other unknown keys within resource body)
Bulk closing of RHQ 4.9 verified items