Seems you can add an attachment via the API, but there's no info returned in the JSON about existing attachments. This would be particularly useful for projects using the API as a way to backup data.
We should check ticket API, wiki API, and the generic _discuss/thread API for attachments on posts.
Seems like wiki API now returns little information (e.g. https://sourceforge.net/rest/p/allura/wiki/Allura%20Wiki/) There are no posts info at all, should we add it? I guess discussion_thread and discussion_thread_url entries as in the tracker API would be helpful.
Also, ticket or wiki page itself can contain attachments, should we add it to the json response too?
Yes and yes. I'm thinking something like:
We don't include http://hostname/ on discussion_thread_url currently but I think that would be good to add, so it is a full URL.
Created #325: [#5652] Attachments info for Allura REST API (3cp)
Regarding hostname prefix. Should we add also 'rest/' to a hostname to link to REST API?
i.e url should be http://sourceforge.net/p/allura/tickets/_discuss/thread/98fc391d/ or http://sourceforge.net/rest/p/allura/tickets/_discuss/thread/98fc391d/?
Originally by: *anonymous
Yes, include 'rest/' in those URLs.
You seem to have CSS turned off.
Please don't fill out this field.
Closed #325. je/42cc_5652
This is really great, just one issue with how the changes to the JSON results for an individual wiki page. I saw tests changes like:
- assert r.json['title'] == 'Home', r.json
+ assert r.json['page']['title'] == 'Home', r.json
Which made me realize we were changing the output format of the results. It's all nested within a 'page' attribute. This will break any existing users of the API, so we don't want to do that. Maybe you could use something like this instead, so unnecessary new nesting isn't added:
def index(self, **kw):
- return dict(page=self.page)
+ return self.page.__json__()
Created #357. [#5652] Revert changes to output format for wiki page api (followup to #325) (1cp)
Closed #357. All changes in je/42cc_5652
Log in to post a comment.