Skip to content
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

getChatRooms response JSON is not using correct names #20

Open
mikee805 opened this issue Mar 9, 2019 · 0 comments
Open

getChatRooms response JSON is not using correct names #20

mikee805 opened this issue Mar 9, 2019 · 0 comments

Comments

@mikee805
Copy link

mikee805 commented Mar 9, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant