Skip to content

CBOR codegen for enum-keyed maps in CborEncodeValue template#3799

Merged
kai-ion merged 4 commits intomainfrom
cbor-serialization
Apr 17, 2026
Merged

CBOR codegen for enum-keyed maps in CborEncodeValue template#3799
kai-ion merged 4 commits intomainfrom
cbor-serialization

Conversation

@kai-ion
Copy link
Copy Markdown
Collaborator

@kai-ion kai-ion commented Apr 16, 2026

Issue #, if available:

Description of changes:

The CBOR encode template always serialized map keys with .c_str(), assuming string keys. This fails to compile when the map key is an enum type (e.g. GetEntitlementFilterName in Marketplace Entitlement).

Add a conditional to use the enum mapper (GetNameFor...) when the map key is an enum, matching the existing pattern in the JSON template.

Check all that applies:

  • Did a review by yourself.
  • Added proper tests to cover this PR. (If tests are not applicable, explain.)
  • Checked if this PR is a breaking (APIs have been changed) change.
  • Checked if this PR will not introduce cross-platform inconsistent behavior.
  • Checked if this PR would require a ReadMe/Wiki update.

Check which platforms you have built SDK on to verify the correctness of this PR.

  • Linux
  • Windows
  • Android
  • MacOS
  • IOS
  • Other Platforms

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

The CBOR encode template always serialized map keys with .c_str(),
assuming string keys. This fails to compile when the map key is an enum
type (e.g. GetEntitlementFilterName in Marketplace Entitlement).

Add a conditional to use the enum mapper (GetNameFor...) when the map
key is an enum, matching the existing pattern in the JSON template.
@kai-ion kai-ion enabled auto-merge April 16, 2026 18:42
@kai-ion kai-ion added this pull request to the merge queue Apr 16, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 16, 2026
@kai-ion kai-ion added this pull request to the merge queue Apr 16, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to Branch Protection failures Apr 16, 2026
You're not authorized to push to this branch. Visit "About protected branches" for more information.
@pulimsr pulimsr added this pull request to the merge queue Apr 17, 2026
@pulimsr pulimsr removed this pull request from the merge queue due to a manual request Apr 17, 2026
@pulimsr pulimsr enabled auto-merge April 17, 2026 08:45
@pulimsr pulimsr added this pull request to the merge queue Apr 17, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to Branch Protection failures Apr 17, 2026
You're not authorized to push to this branch. Visit "About protected branches" for more information.
@kai-ion kai-ion merged commit a72a9f0 into main Apr 17, 2026
5 of 6 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.

3 participants