Exporting enum values as a string rather than int

Godot Version

4.3

Question

I have resources that have:
@export var enum_val : ENUM

The issue I’m having with this is that whenever I update the list of enum values the resources reference the enum value by index in the enum causing things to break if I add a an entry at the top of the enum.

I know I can solve this by assigning each enum entry with a value i.e
enum ENUM
{
foo = 0,
bar = 1,
}
Or by only adding to the bottom only.
Both of these feel error prone, so I think the ideal solution would be if the Resource tracked its value via “foo” or “bar” instead of exporting as 0 or 1.

Idk if this is possible with the given export options though…

Thanks.

In other words, I want to export an enum as a list of string options that are the enums key array.

Something like:
@export_enum(ENUM.keys()) var…

Currently looking at @export_custom to see if it can work, but its a little confusing lol