-
Notifications
You must be signed in to change notification settings - Fork 46
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
Add helper function to facilitate use of library with oneOf types #403
Conversation
@uasouz thank you! Can u please sign your commit? |
@uasouz
I would say it depends on tastes. I would change the name from getDefinition() to And regarding implementation, rather that using instrospection on DeserializateHelper to change the value of the intenal field, I would generate code that assigns the internal field in every constructor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned previously, I would change method name and the deserialization approach.
custom-generator/src/main/java/io/serverlessworkflow/generator/AllAnyOneOfSchemaRule.java
Outdated
Show resolved
Hide resolved
api/src/main/java/io/serverlessworkflow/serialization/DeserializeHelper.java
Outdated
Show resolved
Hide resolved
56e0074
to
04c3354
Compare
@fjtirado Thanks for the feedback, I will adjust the PR accordingly and send new commits soon. @ricardozanini Sorry for many force commits, had small issue with bad config not signing with mixed git configs. |
@uasouz please try squashing your commits and sign it. |
The PR is updated. I squashed the commits and looks like they are signed and verified. But it still fails the check. I have to figure out why. But if there is anything else I can change on the PR, just comment. |
…selecting current type of item instead of checking all of them Add Interface and Implement it Add assignment on constructor Signed-off-by: Vinícius Moraes Lopes <vlopes45@gmail.com>
@uasouz since this is your first contribution, the checks only happen when I approve the run. It's a security measurement from GH. |
AnyMany thanks for submitting your Pull Request ❤️!
What this PR does / why we need it:
I was using the library and it felt a by unconfortable to check every item on an oneOf if it was null or not to define it inner type so i made a minor tweak on generator and deserializers to haver a hint allowing the use of a switch expression to select the type.
Here follows a example of usage:
Special notes for reviewers:
I'm open to comments and reviews and still can contribute on this PR
Additional information (if needed):