feat: Add file rename functionality via PATCH /vault/{filepath} #176
+253
−18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
adds file rename functionality to the Obsidian Local REST API
API Usage
Rename a file using PATCH with these headers:
Implementation Details
/vault/{filepath}
Operation: replace
(legacy compatibility)Target-Type: file
Target: name
app.fileManager.renameFile()
to update internal vault referencesCommit Structure
This PR contains 5 commits extracted from git history:
fix: Add null check for Target header in PATCH requests
fix: improve error messages for PATCH operations
feat: Add file rename endpoint with PATCH /vault/{filepath}
test: Add tests for file rename operation
docs: Add OpenAPI documentation for file rename operation
Testing
Includes tests for:
Files Modified
src/requestHandler.ts
- Core implementation and fixessrc/requestHandler.test.ts
- Test coveragesrc/constants.ts
- Error message improvementsdocs/openapi.yaml
- API documentationdocs/src/lib/patch.jsonnet
- Documentation templates