Comment 2 for bug 1171510

Revision history for this message
Miranda Zhang (miranda-zhang-q) wrote :

I'm trying out the API and came across the following behaviour:

I didn’t see doc about this, so I’m wondering is this a bug or a feature?

If I introduce non existing field to the json request body when using the identity add user API(POST v2.0/users http://docs.openstack.org/api/openstack-identity-service/2.0/content/POST_addUser_v2.0_users_User_Operations_OS-KSADM.html), it get added without error.

I tested on a DevStack installation of OpenStack

curl -X POST -H "X-Auth-Token: Xx1=" -d '{"user":{"name":"name_6","pass-none-exist":"test-none-exist","non-existing":"non-existing", "anything-bool":false}}' -H 'Content-type: application/json' http://130.102.155.7:35357/v2.0/users

Get the response:
{"user": {"name": "name_6", "pass_none_exist": "test-none-exist", "enabled": true, "non_existing": "non-existing", "anything_bool": false, "id": "2fb0955de04b481ab39dd393837cd8b4"}}

Checking using command line tool
keystone user-get name_6

+-----------------+----------------------------------+
| Property | Value |
+-----------------+----------------------------------+
| anything_bool | False |
| enabled | True |
| id | 2fb0955de04b481ab39dd393837cd8b4 |
| name | name_6 |
| non_existing | non-existing |
| pass_none_exist | test-none-exist |
+-----------------+----------------------------------+

now I can’t really tell what is allowed and what is not…