Add support for files in PersonalSnippet REST API
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
- [-] Changelog entry
- [-] Documentation (if required)
-
Code review guidelines -
Merge request performance guidelines -
Style guides - [-] Database guides
- [-] Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
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