-
Notifications
You must be signed in to change notification settings - Fork 0
Expose server version information in Capabilities #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: i2h3 <142165879+i2h3@users.noreply.github.com>
Co-authored-by: i2h3 <142165879+i2h3@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds server version information to Capabilities by parsing ocs.data.version from the OCS capabilities response, so downstream clients can gate behavior by Nextcloud version.
Changes:
- Add
major,minor,patch(Int64) toCapabilities - Parse
version.major,version.minor,version.microfrom the capabilities JSON during initialization - Update/add tests to validate version parsing and handling of missing version data
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Sources/NextcloudCapabilitiesKit/Capabilities.swift | Adds version fields and parsing logic to the main Capabilities initializer. |
| Tests/NextcloudCapabilitiesKitTests/CapabilitiesTests.swift | Adds assertions for version parsing and adds cases for missing/different versions. |
| Tests/NextcloudCapabilitiesKitTests/Talk/Config/SpreedCallTests.swift | Reorders imports (no functional change). |
| Tests/NextcloudCapabilitiesKitTests/Shares/ShareeTests.swift | Reorders imports (no functional change). |
| Tests/NextcloudCapabilitiesKitTests/Shares/FilesSharingTests.swift | Reorders imports (no functional change). |
| Tests/NextcloudCapabilitiesKitTests/NotifyPush/EndpointsTests.swift | Reorders imports (no functional change). |
| Tests/NextcloudCapabilitiesKitTests/Files/FilesTests.swift | Reorders imports (no functional change). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "capabilities": { | ||
| "core": { | ||
| "webdav-root": "remote.php/webdav" |
Copilot
AI
Feb 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The validData JSON string is currently invalid because there’s a trailing comma before the closing } of the capabilities object. JSONSerialization will fail to parse this and the test will fail; remove the trailing comma so the JSON is valid.
The Capabilities struct now exposes server version information from the OCS capabilities response, enabling downstream clients to adapt behavior based on Nextcloud server version.
Changes
Capabilities:major,minor, andpatch(non-optionalInt64)ocs.data.version.{major,minor,micro}in the capabilities JSONUsage
The initialization returns
nilif version information is absent, consistent with existing validation behavior.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.