openfire-restAPI-plugin
openfire-restAPI-plugin copied to clipboard
getChatRooms response JSON is not using correct names
https://github.com/igniterealtime/openfire-restAPI-plugin/blob/master/src/java/org/jivesoftware/openfire/plugin/rest/entity/MUCRoomEntities.java has :
@XmlElement(name = "chatRoom") @JsonProperty(value = "chatRooms") public List<MUCRoomEntity> getMucRooms() { return mucRooms; }
therefore the JSON should produce an element chatRooms but what is produced is mucRooms:
1 < 200 1 < Content-Type: application/json 1 < Date: Sat, 09 Mar 2019 04:28:52 GMT 1 < Transfer-Encoding: chunked 1 < Vary: Accept-Encoding 1 < X-Frame-Options: same { "mucRooms": [{ "roomName": "test", "description": "", "password": null, "subject": null, "naturalName": "test", "maxUsers": 1000, "creationDate": 1552091703656, "modificationDate": 1552091703656, "persistent": true, "publicRoom": false, "registrationEnabled": false, "canAnyoneDiscoverJID": false, "canOccupantsChangeSubject": false, "canOccupantsInvite": true, "canChangeNickname": false, "logEnabled": true, "loginRestrictedToNickname": false, "membersOnly": true, "moderated": true, "broadcastPresenceRoles": ["moderator", "participant", "visitor"], "owners": ["admin@${HOST}"], "ownerGroups": [], "admins": [], "adminGroups": [], "members": [], "outcasts": [], "outcastGroups": [] }] }
this is preventing the rest API client from correctly un-marshaling the JSON since it expects the element to be named "chatRooms" see: https://github.com/igniterealtime/REST-API-Client/blob/master/src/main/java/org/igniterealtime/restclient/entity/MUCRoomEntities.java
verified by removing the @XmlElement from the client entity.
However fixing this might just break other clients that are expecting "mucRooms".
This is probably a problem for all entities that rely on @JsonProperty for renaming.