processone / ejabberd

Robust, Ubiquitous and Massively Scalable Messaging Platform (XMPP, MQTT, SIP Server)
https://www.process-one.net/en/ejabberd/
Other
6k stars 1.5k forks source link

Return type of get_vcard API call changed (and is different from docs) #4198

Closed sarsonj closed 2 months ago

sarsonj commented 2 months ago

Before creating a ticket, please consider if this should fit the discussion forum better.

Environment

Bug description

We have updated ejabberd from 21.04 to 24.04.

We are now testing our application and we found that there are some API call changes. We updated our app according to current docs, however, we found change it get_vcard, which doesn't work as should according to docs. The get_vcard should return JSON like this:

HTTP/1.1 200 OK
        {"content": "User 1"}

but this is not true, currently it just returns a value like

HTTP/1.1 200 OK
User 1

Sure, we can update our application, but I'm not sure if this change is a bug or a feature, because the docs at https://docs.ejabberd.im/developer/ejabberd-api/admin-api/#get-vcard don't reflect this change.

badlop commented 2 months ago

Right. That was changed in API v1, introduced in ejabberd 24.02. It is mentioned in the 24.02 release notes, in the section named mod_http_api not named results.

You can continue using API v0, which behaves as previous ejabberd versions, until you are able to update your ReST client.

What confused you is a problem in the documentation: the examples were not updated! Thanks for reporting, i'll investigate why they didn't get updated.

badlop commented 2 months ago

Documentation is updated, now it reflects the current behaviour, for example https://docs.ejabberd.im/developer/ejabberd-api/admin-api/#get-vcard