Skip to content

Support for Custom Type Mapping with ext.NativeTypes in cel-go #1194

@hadidimad

Description

@hadidimad

Feature request checklist

  • [ *] There are no issues that match the desired change
  • [ *] The change is large enough it can't be addressed with a simple Pull Request
  • If this is a bug, please file a Bug Report.

Change
Hi team,

I'm currently using cel-go and leveraging ext.NativeTypes to work with Go structs in the CEL environment. I also have a custom TypeProvider implementation to support a custom Decimal type.

While exploring the ext/native_types.go package, I noticed that there is a mapping mechanism that translates Go struct types to CEL types. This has been very useful for working with standard Go structs.

My question is:
Is there a way to register or extend this mapping mechanism to include my own custom types, such as the custom Decimal type I'm working with? If so, what would be the recommended approach?

Any guidance or examples would be greatly appreciated.

Thanks in advance for your help!

Best regards,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions