Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Generating toString, hashCode and equals for Java classes generated from RAML DataTypes #223

Closed
mplanchant opened this issue Mar 15, 2017 · 7 comments

Comments

@mplanchant
Copy link

It is possible to generate Java classes with toString, hashCode and equals methods from JSON schemas (described here). Is this possible when Java classes are generated from RAML DataTypes?

@jstoiko
Copy link
Contributor

jstoiko commented Apr 13, 2017

@mplanchant: you should be able to use RAML 1.0 annotations along with those plugins. I hope that helps.

@jstoiko jstoiko assigned jstoiko and unassigned jpbelang and jstoiko Apr 13, 2017
@podviaznikov
Copy link

I think this one is important. Otherwise, those generated files need to be modified which defeats the purpose of generation a bit.

@jpbelang
Copy link
Contributor

the raml-java-tools is coming with plugins to allow this

@jpbelang jpbelang added this to To do in 3.0.0 Dec 23, 2017
jpbelang added a commit to mulesoft-labs/raml-java-tools that referenced this issue Feb 18, 2018
@jpbelang
Copy link
Contributor

equals and hashCode are in for ObjectTypeDeclaration. I'll do unions later today.

jpbelang added a commit to mulesoft-labs/raml-java-tools that referenced this issue Feb 18, 2018
@jpbelang
Copy link
Contributor

unions are done.
The plugin can be set in the pom.xml or you can set it on the API of type directly (where you can specify a list of fields to consider field names. I'll do toString() in a separate plugin.

@jpbelang jpbelang moved this from To do to In progress in 3.0.0 Feb 18, 2018
@jpbelang
Copy link
Contributor

toString plugin for types, called core.toString

@jstoiko
Copy link
Contributor

jstoiko commented Mar 1, 2018

@jstoiko jstoiko closed this as completed Mar 20, 2018
3.0.0 automation moved this from In progress to Done Mar 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
No open projects
3.0.0
  
Done
Development

No branches or pull requests

4 participants