-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API: /getActiveEntities response #965
Comments
I agree with changing the response, that sounds more logical to me. |
@humboldtux changes have been made to the master branch; could you please test it and close this ticket if it is ok for you? Many thanks! |
This is on the orthagh:9.1/apijson.org_compat branch, not on the master; sorry for the confusion. |
I get: {
"active_entity": {
"id": 1,
"active_entity_recursive": true,
"active_entities": [1, 2]
}
} Where {
"active_entity": {
"id": 1,
"active_entity_recursive": true,
"active_entities": [{
"id": 1
}, {
"id": 2
}]
}
} would be easier to parse. |
still on my fork, you should have an array instead of an object on key active_entities |
Fixed in the master, the real one! :) |
@orthagh, whether from updated master or your fork, i'm still getting {
"active_entity": {
"id": 1,
"active_entity_recursive": true,
"active_entities": [1, 2]
}
} Is it the definitive response you want to return? not: {
"active_entity": {
"id": 1,
"active_entity_recursive": true,
"active_entities": [{
"id": 1
}, {
"id": 2
}]
}
} |
It shouldn't : 406f0fe#diff-e01cdca9469fc2d2fa8a60ea83250903R303 It's now on this repo master |
Using latest master, I still have the incorrect output:
|
oh ok, i missed you want this kind of output |
I get this answer by requesting /getActiveEntities:
$ curl -H "Session-Token: 7r7436i0u4m0qqdn0v5rc43el5" 'http://glpi.lan:8080/apirest.php/getActiveEntities'
{"active_entity":1,"active_entity_recursive":true,"active_entities":{"1":1,"2":2}}
Where, from the official API documentation, the response should be:
{"active_entity":1,"active_entity_recursive":true,"active_entities":[{"1":1},{"2":2}]}
Even better, could the reponse of this endpoint be changed to:
{"active_entity":{"id":1,"active_entity_recursive":true,"active_entities":[{"id":1},{"id":2}]}}
It follows http://jsonapi.org/, and is easier to parse.
I'm using Master.
Server configuration:
The text was updated successfully, but these errors were encountered: