#5652 No attachment info for Allura API

v1.0.0
closed
nobody
General
2015-08-20
2013-01-23
Chris Tsai
No

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.

Related

Tickets: #5652
Tickets: #6267

Discussion

  • Dave Brondsema

    Dave Brondsema - 2013-04-22
    • labels: support, p3 --> support, p3, 42cc
    • Milestone: limbo --> forge-backlog
     
  • Dave Brondsema

    Dave Brondsema - 2013-04-22

    We should check ticket API, wiki API, and the generic _discuss/thread API for attachments on posts.

     
  • Igor Bondarenko - 2013-04-23

    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?

     
  • Dave Brondsema

    Dave Brondsema - 2013-04-23

    Yes and yes. I'm thinking something like:

    { ....
      "attachments": [
         "http://sourceforge.net/p/allura/wiki/Allura%20Wiki/attachment/PyCon_2011.pdf",
      ]
    }
    

    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.

     
  • Dave Brondsema

    Dave Brondsema - 2013-04-23

    Or perhaps:

    { ....
      "attachments": [
         {"bytes":510840, "url":"http://sourceforge.net/p/allura/wiki/Allura%20Wiki/attachment/PyCon_2011.pdf"},
      ]
    }
    
     
  • Igor Bondarenko - 2013-04-24
    • status: open --> in-progress
     
  • Anonymous - 2013-04-24

    Originally by: *anonymous

    Yes, include 'rest/' in those URLs.

     
  • Chris Tsai - 2013-04-26
    • labels: support, p3, 42cc --> support, p3, 42cc, allura-api
     
  • Igor Bondarenko - 2013-05-09
    • status: in-progress --> code-review
     
  • Igor Bondarenko - 2013-05-09

    Closed #325. je/42cc_5652

     
  • Dave Brondsema

    Dave Brondsema - 2013-05-16
    • QA: Dave Brondsema
     
  • Dave Brondsema

    Dave Brondsema - 2013-05-16
    • status: code-review --> in-progress
     
  • Dave Brondsema

    Dave Brondsema - 2013-05-16

    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:

    ::diff
    -        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:

    ::diff
         @expose('json:')
         def index(self, **kw):
    -        return dict(page=self.page)
    +        return self.page.__json__()
    
     
  • Igor Bondarenko - 2013-05-17

    Created #357. [#5652] Revert changes to output format for wiki page api (followup to #325) (1cp)

     

    Related

    Tickets: #5652

  • Igor Bondarenko - 2013-05-20

    Closed #357. All changes in je/42cc_5652

     
  • Igor Bondarenko - 2013-05-20
    • status: in-progress --> code-review
     
  • Dave Brondsema

    Dave Brondsema - 2013-05-20
    • status: code-review --> closed
     

Log in to post a comment.