Open
Description
requirements
When the Scala model is a enumero IndexedEnum, by default it's implicitly converted to a number.
Metarpheus treats it like it's a CaseEnum, expecting it's string value, and this produces an error on the client side.
specs
for an IndexedEnum, like:
@indexedEnum trait Priority {
type Index = Int
object High { 1 }
object Medium { 2 }
object Low { 3 }
}
the current generated code is:
export type Priority =
| 'High'
| 'Medium'
| 'Low'
export const Priority = t.keyof({
High: true,
Medium: true,
Low: true
}, 'Priority')
but should be something like:
export interface Priority extends Newtype<{readonly priority : number}, number> {}
export const Priority = fromNewtype<Priority>()(t.number)