Description
Version: 5.0.18
Platform: Running with Angular (5.x)
Problem: I created a custom ParamType for many reasons, one being so that I didn't have to declare raw: true
in so many places throughout our code. However, I am noticing the raw parameter is not carrying through to the Param itself.
{
encode: ....,
decode: ....,
...
raw: true
}
This line of code shows that raw can be set from either the config or the type itself. However, from a few lines right above, I determined the type is getting reassigned. Within that logic it creates an ArrayType
and the type's original value is never copied over.
Solution: I think it's just as simply as adding type.raw
when creating an ArrayType
as such. Code below copied and modified slightly from the source.
extend(this, {
dynamic: type.dynamic,
raw: type.raw <----- add this
name: type.name,
pattern: type.pattern,
inherit: type.inherit,
is: arrayHandler(type.is.bind(type), true),
$arrayMode: mode,
});
Without this fix, it simply just means every config needs to manually define the raw
config param. Workaround, but not ideal.