Skip to content

Better support for protobuf enum prefixes #721

Description

@Krever

Checklist

Describe the desired behavior

There is a convention in defining protobuf enums to prefix them. See here for more details.

It should be easier to handle that use case.

On solution could be for Chimney to provide a name comaprison strategy like this:

case object ProtobufPrefixStripping extends TransformedNamesComparison {

    def namesMatch(fromName: String, toName: String): Boolean = toName.endsWith(fromName.toUpperCase)
      
}

Use case example

  • (Let me know if not obvious and I will fill it)

How it relates to existing features

This is currently possible but defining the comaprison strategy in user-space. It is rather invonvenient due to the "upstream module requirement" - name comparison code has to be compiled before usage.

Additional context

There might be other solutions to this problem. The end goal is to improve the support for this use case. The proposed solution is just one idea.

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions