Skip to content

Definition *str should expose enumerator keys #431

@joente

Description

@joente

Describe the bug
ThingsDB allows to write and int definition which allows and "integer" enumerator to expose it's values.
By the same logic, *str should expose the names of the enumerator as they are type str and the * prefix wrap-flag tells ThingsDB to expose enumerator keys.

To Reproduce
The following code should expose B

set_enum('E', {A: 41, B: 42});
.e = E{B};
.wrap(&{e: '*str'})

Expected behavior
Expecting the output:

{
  "e": "B"
}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions