8000 Mapping field names based on a constant function · Issue #75 · arainko/ducktape · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Mapping field names based on a constant function #75
Closed
@kyri-petrou

Description

@kyri-petrou

Hi there 👋 First, thank you very much for your work on this library, it's honestly amazing!

I'm not sure whether this is already supported or not, but I was wondering whether it's possible to map from one enum / case class to another applying a constant function to map the field names.

Example:

enum size:
  case small, large

enum Size:
  case Small, Large

In such case, one could transform size -> Size by mapping the field names using the .capitalize method.

Is something like this currently supported by the library? One usecase for this is that API models might use different notations (kebab-case vs snake-case, etc) than DAOs. It would be amazing if there was a way to do this transformation without having to explicitly map all the fields manually!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0