Description of problem: autoAttach attribute of the activation is set to null no when you try to set it to true/false Version-Release number of selected component (if applicable): subscription management server: 2.3.4-1 How reproducible: Steps to Reproduce: [root@shwetha-candlepin server]# curl --stderr /dev/null --insecure --user testuser1:password --request POST --data '{"name":"testuser1_admin-","autoAttach":"false"}' --header 'accept: application/json' --header 'content-type: application/json' https://shwetha-candlepin.usersys.redhat.com:8443/candlepin/owners/admin/activation_keys { "created" : "2018-04-06T10:14:01+0000", "updated" : "2018-04-06T10:14:01+0000", "id" : "8acce3d3629a6d3001629a72dd3d10e8", "name" : "testuser1_admin-", "description" : null, "owner" : { "id" : "8acce3d3629a6d3001629a6e59a90004", "key" : "admin", "displayName" : "Admin Owner", "href" : "/owners/admin" }, "serviceLevel" : null, "autoAttach" : null, -------> autoAttach is set to null and not false "pools" : [ ], "contentOverrides" : [ ], "releaseVer" : { "releaseVer" : null }, "products" : [ ] }[root@shwetha-candlepin server]#curl --stderr /dev/null --insecure --user testuser1:password --request POST --data '{"name":"testuser1_snowwhite-ActivationKey","autoAttach":"true"}' --header 'accept: application/json' --header 'content-type: application/json' https://shwetha-candlepin.usersys.redhat.com:8443/candlepin/owners/snowwhite/activation_keys { "created" : "2018-04-06T10:15:22+0000", "updated" : "2018-04-06T10:15:22+0000", "id" : "8acce3d3629a6d3001629a74186d10ea", "name" : "testuser1_snowwhite-ActivationKey", "description" : null, "owner" : { "id" : "8acce3d3629a6d3001629a6e599d0003", "key" : "snowwhite", "displayName" : "Snow White", "href" : "/owners/snowwhite" }, "serviceLevel" : null, "autoAttach" : null, -------> autoAttach is set to null and not true "pools" : [ ], "contentOverrides" : [ ], "releaseVer" : { "releaseVer" : null }, "products" : [ ] Actual results: Expected results: Additional info:
You've demonstrated "true" and "false" (both strings). What about as the JSON literals (without quotes)?
Still null: [root@localhost ~]# curl -k --request POST --user admin:admin --data '{"name":"truekey","autoAttach": true}' --header 'accept: application/json' --header 'content-type: application/json' https://shwetha-candlepin.usersys.redhat.com:8443/candlepin/owners/admin/activation_keys | python -mjson.tool % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 131 489 0 489 0 37 489 37 --:--:-- --:--:-- --:--:-- 716 { "autoAttach": null, -----------> null and not true "contentOverrides": [], "created": "2018-04-09T14:18:19+0000", "description": null, "id": "8acce3d362aa93090162aac599ca0000", "name": "truekey", "owner": { "displayName": "Admin Owner", "href": "/owners/admin", "id": "8acce3d362aa61090162aa629d250003", "key": "admin" }, "pools": [], "products": [], "releaseVer": { "releaseVer": null }, "serviceLevel": null, "updated": "2018-04-09T14:18:19+0000" }
I cant reproduce it either with following version of candlepin 2.8.0-1, so closing the bug as worksforme [shwetha@shwetha-laptop rhsm-qe]$ curl -k --request POST --user admin:admin --data '{"name":"truekey","autoAttach": true}' --header 'accept: application/json' --header 'content-type: application/json' https://shwetha-workstation.usersys.redhat.com:8443/candlepin/owners/admin/activation_keys | python -mjson.tool % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 579 0 542 100 37 123 8 0:00:04 0:00:04 --:--:-- 132 { "addOns": [], "autoAttach": true, "contentOverrides": [], "created": "2019-09-11T13:23:18+0000", "description": null, "id": "8ac6a3a96c8ae2c7016d207e1a500010", "name": "truekey", "owner": { "displayName": "Admin Owner", "href": "/owners/admin", "id": "8ac6a3a96c6614cf016c6614ed760002", "key": "admin" }, "pools": [], "products": [], "releaseVer": { "releaseVer": null }, "role": null, "serviceLevel": null, "updated": "2019-09-11T13:23:18+0000", "usage": null } [shwetha@shwetha-laptop rhsm-qe]$ curl --stderr /dev/null --insecure --user testuser1:password --request POST --data '{"name":"testuser1_admin-","autoAttach":"false"}' --header 'accept: application/json' --header 'content-type: application/json' https://shwetha-workstation.usersys.redhat.com:8443/candlepin/owners/admin/activation_keys { "created" : "2019-09-11T13:24:22+0000", "updated" : "2019-09-11T13:24:22+0000", "id" : "8ac6a3a96c8ae2c7016d207f167d0011", "name" : "testuser1_admin-", "description" : null, "owner" : { "id" : "8ac6a3a96c6614cf016c6614ed760002", "key" : "admin", "displayName" : "Admin Owner", "href" : "/owners/admin" }, "serviceLevel" : null, "usage" : null, "role" : null, "addOns" : [ ], "autoAttach" : false, "pools" : [ ], "contentOverrides" : [ ], "products" : [ ], "releaseVer" : { "releaseVer" : null } }[