Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

formatTypeMapping fails with primitive types #1126

Closed
HectorBst opened this issue Apr 29, 2020 · 0 comments
Closed

formatTypeMapping fails with primitive types #1126

HectorBst opened this issue Apr 29, 2020 · 0 comments
Milestone

Comments

@HectorBst
Copy link

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.

@joelittlejohn joelittlejohn added this to the 1.1.0 milestone Feb 28, 2021
@joelittlejohn joelittlejohn changed the title formatTypeMapping fail with primitive types formatTypeMapping fails with primitive types Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants