The addition of SchemaMappingTransform is wonderful however it will always return a string.
There are some reasons why you might not want to return a string. Such as in IP Fabrics case we display an interface state as up or down. But I need to be able to convert it to a boolean for a generic InfrahubSchema to be useful to anyone.
Then it would be good to convert the string to another type allowing yes/no or true false, if kind is Number then it converts the string to an int if its valid for the infrahub schema.
The addition of SchemaMappingTransform is wonderful however it will always return a string.
There are some reasons why you might not want to return a string. Such as in IP Fabrics case we display an interface state as
up
ordown
. But I need to be able to convert it to a boolean for a generic InfrahubSchema to be useful to anyone.Interface Schema:
Sync Config
Returning a string will fail as enabled expects a
Boolean
. If there was a way to define the kind in the transforms like so:Then it would be good to convert the string to another type allowing yes/no or true false, if kind is
Number
then it converts the string to an int if its valid for the infrahub schema.