Commit 68ddedf
authored
fix(facet-typescript): emit unit enum variants as strings in mixed tagged enums (#2056)
## Summary
Fix `facet-typescript` enum generation for mixed tagged enums so unit
variants are emitted as bare string literals, matching `facet-json` wire
format.
## Changes
- Emit unit variants as `"name"` in the tagged-enum generation path
(instead of `{ name: "name" }`)
- Add regression test for a `rename_all = "snake_case"` enum mixing
unit, newtype, and struct variants
- Add snapshot asserting expected TypeScript output
## Test Plan
- [x] `cargo nextest run -p facet-typescript`
Closes #20551 parent 3d9442a commit 68ddedf
2 files changed
Lines changed: 28 additions & 2 deletions
File tree
- facet-typescript/src
- snapshots
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
525 | 525 | | |
526 | 526 | | |
527 | 527 | | |
528 | | - | |
529 | | - | |
| 528 | + | |
| 529 | + | |
530 | 530 | | |
531 | 531 | | |
532 | 532 | | |
| |||
820 | 820 | | |
821 | 821 | | |
822 | 822 | | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
823 | 840 | | |
824 | 841 | | |
825 | 842 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
0 commit comments