Skip to content

Add support for files in PersonalSnippet REST API

Vijay Hawoldar requested to merge vij-add-files-to-snippet-create-endpoint into master

What does this MR do?

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

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

Refs #217739 (closed)

No changelog or docs changes have been added due to full multi-file snippet support is behind a 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/snippets"
Edited by Vijay Hawoldar

Merge request reports