feat: add support for RFC6243 with-defaults #136

Merged
nemith merged 1 commit from brb/push-tzuqvlsxovmt into main 2026-01-08 18:47:03 +00:00
nemith commented 2026-01-08 17:44:08 +00:00 (Migrated from github.com)

Add support for with-defaults which extends , , and with a optional <with-defaults> element.

Add support for with-defaults which extends <get>, <get-config>, and <copy-config> with a optional `<with-defaults>` element.
copilot-pull-request-reviewer[bot] (Migrated from github.com) reviewed 2026-01-08 17:47:00 +00:00
copilot-pull-request-reviewer[bot] (Migrated from github.com) left a comment

Pull request overview

This PR implements support for RFC6243 with-defaults capability in NETCONF operations. The implementation adds an optional <with-defaults> element to <get>, <get-config>, and <copy-config> operations, allowing clients to control how default values are reported by the server.

  • Defines WithDefaultsMode type with four RFC6243-compliant mode constants
  • Extends Get, GetConfig, and CopyConfig structs with optional WithDefaults field
  • Updates XML marshaling to conditionally include the <with-defaults> element with proper namespace

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
rpc/with_defaults.go Defines WithDefaultsMode type, RFC6243 mode constants, and helper struct for XML marshaling
rpc/with_defaults_test.go Comprehensive tests for XML marshaling of with-defaults in all three supported operations
rpc/rpc.go Adds WithDefaults field to Get struct and updates MarshalXML to include with-defaults element
rpc/config.go Adds WithDefaults field to GetConfig and CopyConfig structs with corresponding MarshalXML updates
README.md Updates RFC6243 status from "planned" to "supported" in the features table
TODO.md Marks with-defaults as completed in the RFC support checklist

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

## Pull request overview This PR implements support for RFC6243 with-defaults capability in NETCONF operations. The implementation adds an optional `<with-defaults>` element to `<get>`, `<get-config>`, and `<copy-config>` operations, allowing clients to control how default values are reported by the server. - Defines `WithDefaultsMode` type with four RFC6243-compliant mode constants - Extends `Get`, `GetConfig`, and `CopyConfig` structs with optional `WithDefaults` field - Updates XML marshaling to conditionally include the `<with-defaults>` element with proper namespace ### Reviewed changes Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments. <details> <summary>Show a summary per file</summary> | File | Description | | ---- | ----------- | | rpc/with_defaults.go | Defines `WithDefaultsMode` type, RFC6243 mode constants, and helper struct for XML marshaling | | rpc/with_defaults_test.go | Comprehensive tests for XML marshaling of with-defaults in all three supported operations | | rpc/rpc.go | Adds `WithDefaults` field to `Get` struct and updates `MarshalXML` to include with-defaults element | | rpc/config.go | Adds `WithDefaults` field to `GetConfig` and `CopyConfig` structs with corresponding `MarshalXML` updates | | README.md | Updates RFC6243 status from "planned" to "supported" in the features table | | TODO.md | Marks with-defaults as completed in the RFC support checklist | </details> --- 💡 <a href="/nemith/netconf/new/main/.github/instructions?filename=*.instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add Copilot custom instructions</a> for smarter, more guided reviews. <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn how to get started</a>.
Sign in to join this conversation.
No description provided.