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

Fix #295 #325

Closed
wants to merge 2 commits into from
Closed

Fix #295 #325

wants to merge 2 commits into from

Conversation

cvgaviao
Copy link
Contributor

Signed-off-by: Cristiano V. Gavião [email protected]

Motivation:
Allows the developer to have enum in their data classes that need to convert from and to JSON.
#295

Signed-off-by: Cristiano V. Gavião <[email protected]>
@vietj vietj added this to the 4.0.4 milestone Mar 17, 2021
@vietj
Copy link
Member

vietj commented Mar 19, 2021

can you remove those extra commits for NPE so we can review only the new feature and then we will examine the commits that fix potential NPE

@cvgaviao
Copy link
Contributor Author

can you remove those extra commits for NPE so we can review only the new feature and then we will examine the commits that fix potential NPE

done


/**MyEnumWithCustomConstructor doc*/
@VertxGen
public enum MyEnumWithCustomConstructor {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be renamed with XXXWithCustomFactory because constructor has a very specific meaning

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I did the required changes... :D

But it is really called an enum constructor, not a factory :)
Look here: https://docs.oracle.com/javase/tutorial/java/javaOO/enum.html

import io.vertx.core.json.JsonObject;

@DataObject(generateConverter = true, publicConverter = true)
public class DataObjectWithEnumWithMapper {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DataObjectWithMappedEnum

@vietj
Copy link
Member

vietj commented Mar 22, 2021

A couple comments have been made to rename things more consistently.

Signed-off-by: Cristiano V. Gavião <[email protected]>
@vietj
Copy link
Member

vietj commented Mar 23, 2021

I think we need also then to update the index.adoc and the @README` files to somehow say that now enums can be seen as data object when convenient, i.e when the code generator might want to look at this from this perspective.

@vietj
Copy link
Member

vietj commented Mar 25, 2021

@cvgaviao can you update the index.adoc and readme files with the changes brought the to model ?

@vietj vietj modified the milestones: 4.0.4, 4.1.0 Mar 30, 2021
@vietj vietj modified the milestones: 4.1.0, 4.1.1 Jun 1, 2021
@vietj vietj modified the milestones: 4.1.1, 4.2.0 Jul 2, 2021
@Fyro-Ing
Copy link
Contributor

How can we help to get this feature ?
we could use it with swagger-codegen (after adding a vertx module to generate with @dataobject on project) to have a full OpenAPI contracts compliance & use service proxies or new web api service

@vietj
Copy link
Member

vietj commented Sep 11, 2021

this PR is missing update to documentation as said in my last comment, if you can contribute it it is fine

@Fyro-Ing
Copy link
Contributor

Update files here Fyro-Ing@1939916

if @cvgaviao can't merge in few days, i'll do a PR directly

Note : Readme updated to conform with json-mappers.properties, not @Mapper

@vietj
Copy link
Member

vietj commented Sep 13, 2021 via email

@cvgaviao
Copy link
Contributor Author

@Fyro-Ing, you can do that. ;)
I'm not using vert.x in my new job, and the company that I did this PR for also stopped using it.

Update files here Fyro-Ing@1939916

if @cvgaviao can't merge in few days, i'll do a PR directly

Note : Readme updated to conform with json-mappers.properties, not @Mapper

@Fyro-Ing
Copy link
Contributor

new PR #341

@vietj vietj closed this Oct 25, 2021
@vietj
Copy link
Member

vietj commented Oct 25, 2021

merged with new PR.

@vietj vietj removed this from the 4.2.0 milestone Oct 25, 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

Successfully merging this pull request may close these issues.

3 participants