Skip to content

Add support for files in ProjectSnippets REST API

What does this MR do?

This MR adds a new parameter called files to the ProjectSnippets REST API create endpoint.

This will add support for adding multiple files when creating a ProjectSnippet, when the feature flag is enabled (or removed in future).

Refs #217739 (closed)

Support for files was added to the PersonalSnippet endpoint, here

No changelog or docs changes have been added due to full multi-file snippet support being behind the snippet_multiple_files feature flag. We have an issue to track the addition of the docs for this, here: #217808 (closed)

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Testing

You can test this MR with the following example:

curl --request POST \
     --data '{ "title": "Testing Creation", "visibility": "public", "files": [{"file_path": "testing.md","content": "my content"}]}' \
     --header 'Content-Type: application/json' \
     --header "PRIVATE-TOKEN: <Your Token Here>" \
     "http://127.0.0.1:3000/api/v4/projects/:id/snippets"
Edited by Vijay Hawoldar

Merge request reports