Skip to content

CRUD code generation fails with Mapperly: missing mapping AbpHelperGenerateCrudInput -> CrudCommandOption #208

@omer-repo

Description

@omer-repo

Title

CRUD CodeGeneration fails with Mapperly: missing mapping AbpHelperGenerateCrudInput -> CrudCommandOption

Description

When running CRUD code generation in ABP Helper GUI, the operation fails with an ABP/Mapperly exception indicating that no object mapping exists for the DTO-to-command mapping.

The crash happens when the GUI layer maps the input DTO to the Core command option via ObjectMapper.Map<,>.

Exception

Volo.Abp.AbpException: No object mapping was found for the specified source and destination types.
Mapping attempted: AbpHelperGenerateCrudInput -> CrudCommandOption EasyAbp.AbpHelper.Gui.CodeGeneration.Crud.Dtos.AbpHelperGenerateCrudInput -> EasyAbp.AbpHelper.Core.Commands.Generate.Crud.CrudCommandOption

(Stack trace points to ObjectMapper.Map<AbpHelperGenerateCrudInput, CrudCommandOption>(input) in the CRUD generation app service.)

Expected behavior

CRUD generation should work without requiring consumer projects to add custom object mapping configuration for ABP Helper’s own DTOs/options.

Actual behavior

Generation fails at runtime because the mapping pair is not defined/registered for Mapperly.

Root cause (likely)

With ABP’s Mapperly integration, mappings are not implicit. ABP Helper GUI calls ObjectMapper.Map<,> but does not provide a Mapperly mapper (e.g., MapperBase<TSource, TDestination>) for this DTO → option mapping.

Workarounds

  • Manually map AbpHelperGenerateCrudInput into CrudCommandOption (avoid ObjectMapper.Map).
  • Add a Mapperly mapper in the GUI application (requires adding Volo.Abp.Mapperly package references).

Suggested fix

Ship a built-in mapping for:

  • AbpHelperGenerateCrudInputCrudCommandOption

Options:

  • Replace the ObjectMapper.Map call with explicit/manual mapping inside ABP Helper.
  • Or add a Mapperly mapper (MapperBase<,>) in the correct assembly/module so it’s discovered and registered automatically.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions