Skip to content

Adds gNMI extensions output formatting#799

Merged
karimra merged 1 commit intoopenconfig:mainfrom
Voronar:ext_decode
Feb 16, 2026
Merged

Adds gNMI extensions output formatting#799
karimra merged 1 commit intoopenconfig:mainfrom
Voronar:ext_decode

Conversation

@Voronar
Copy link
Contributor

@Voronar Voronar commented Feb 13, 2026

Resolves #761.

Input:

gnmic -a 127.0.0.1 --insecure \
	--proto-dir protos \
	--proto-file ext1.proto \
	--proto-file ext2.proto \
	--registered-extensions 10:package1.Message1 \
	--registered-extensions 20:package2.Message2 \
	get --target node1 --path root:/

Output:

{
	// ...
	"extension": [
    {
      "Ext": {
        "RegisteredExt": {
          "id": 10,
          "msg": "protobytes"
        }
      }
    },
    {
      "Ext": {
        "RegisteredExt": {
          "id": 20,
          "msg": "protobytes"
        }
      }
    }
  ],
	"decodedExtensions": {
		"10": { "ext1_message": { "msg1_field": 10 } },
		"20": { "ext2_message": { "msg2_field": 20 } }
	}
}

It should work for all types of responses (get, set, sub).

@google-cla
Copy link

google-cla bot commented Feb 13, 2026

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@karimra
Copy link
Collaborator

karimra commented Feb 16, 2026

Thanks for the contribution!
the --proto-dir and --proto-file were not added for this purpose but I guess it's a good way to reuse flags.

@karimra karimra merged commit edc86db into openconfig:main Feb 16, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support decoding extensions

2 participants