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

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

Closed
sarsonj opened this issue Apr 11, 2024 · 2 comments
Closed

Comments

@sarsonj
Copy link
Contributor

sarsonj commented Apr 11, 2024

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

Environment

  • ejabberd version: 24.02
  • OS: Linux (Debian)
  • Installed from: source

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 badlop self-assigned this Apr 11, 2024
@badlop
Copy link
Member

badlop commented Apr 11, 2024

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 badlop added this to the ejabberd 24.xx milestone Apr 11, 2024
badlop added a commit that referenced this issue Apr 12, 2024
Since ejabberd 24.02, mod_http_api does not name any results,
previously integer and strings were named, but other results were not.
And ejabberdctl obviously does not name results either.
Only ejabberd_xmlrpc does.
Consequently, the documentation should not name results in the examples.
@badlop
Copy link
Member

badlop commented Apr 12, 2024

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

@badlop badlop closed this as completed Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants