Code Snipppets API not returning link to raw code

Issue #13619 open
Jesse Yowell
staff created an issue

There has been a recent change in the Code Snippets API that no longer returns a value for files."foo.txt".links.self in the case of the API documentation.

https://developer.atlassian.com/bitbucket/api/2/reference/resource/snippets/%7Busername%7D/%7Bencoded_id%7D

This removal breaks jQuery implementations where users want to display the contents of the Code Snippet markup within their website.

Comments (3)

  1. Erik van Zijst

    While we work on a fix for this, there is a workaround you can use for now.

    Every API endpoint supports "Partial Responses" that allow clients to both prune unwanted elements from a response, as well as pull in additional elements. This system is described in detail here: https://developer.atlassian.com/bitbucket/api/2/reference/meta/partial-response

    You can use that to explicitly pull in the missing files elements like this:

    https://api.bitbucket.org/2.0/snippets/bitbucket/E56bA?fields=%2Bfiles..links..*

    (Note that "%2B" is just a urlencoded "+")

  2. Log in to comment