Skip to content

Standardize use of `content` parameter in snippets API

Stan Hu requested to merge sh-support-content-for-snippets-api into master

There was some confusion over whether code or content is the right parameter for snippets. Internally, the database stores content. However:

  1. Project snippets use code. code gets remapped in content in lib/api/project_snippets.rb.

  2. Personal snippets use content.

To unify these APIs, allow an alias of content to work for project snippets.

I'm holding off updating the docs to reflect this because https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/32295 needs to be merged and pick into older releases.

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/66673

Edited by Stan Hu

Merge request reports