Skip to content

Strongly Typed Content Item Converter does not support mapping name from an Option #23

Open
@aweigold

Description

@aweigold

Motivation

When rendering a multiple choice elements in a strongly typed model, one must access the List<Option> value property of the MultipleChoiceElement class, which might be tedious. There should be a more straightforward path to the names of options.

One potential way to handle this would be like the following:

@ContentItemMapping("product")
public class Product {
  @ElementMapping("product_categories")
  List<Option> productCategories;

  //New feature
  @ElementMappingOption(elementCodeName = "product_categories", optionCodeName = "footwear")
  Boolean isFootwear;
}

Original description

If an Option is mapped to a field, the name from the option should be used.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions