Skip to content

formatTypeMapping fails with primitive types #1126

@HectorBst

Description

@HectorBst

Hi,

Use the formatTypeMapping config with primitive types throw an exception at generation.

For instance:

<formatTypeMapping>
	<int32>int</int32>
	<int64>long</int64>
</formatTypeMapping>

Will result to:
[ERROR] Failed to execute goal org.jsonschema2pojo:jsonschema2pojo-maven-plugin:1.0.2:generate (default) on project Test: Execution default of goal org.jsonschema2pojo:jsonschema2pojo-maven-plugin:1.0.2:generate failed: int is a primitive

The error seems to come from the apply method of the FormatRule class, which should not call JCodeModel.ref with primitive types.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions