Skip to content

[Enhancement] Support @DictFormat annotation for code-label (dictionary) conversion #988

Description

@nkuprins

Search before asking

  • I searched in the issues and found nothing similar.

Motivation

A field stores a code (1), the sheet should show a label (Success). Today that requires a hand-written Converter class per dictionary - there's no built-in way to declare a code↔label mapping on a field.

Solution

An annotation-based dictionary converter, @DictFormat, with an inline "code=label" form and an enum-backed form for dictionaries that already exist in the domain model.

Full design (API shape, field-type scope, validation rules, and two open questions) is written up here:
#198 (comment)
To avoid duplication, I will not repeat the same here.

I am open to changes. If this gets approved and someone answers the 2 questions mentioned there, then I can start gradually implementing that.

Alternatives

No response

Anything else?

Related: #198 (original request, Jan 2025)

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussion welcomeWelcome to join the discussion togetherenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions