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

Support "required" keyword draft04 array-style when generating constuctors #599

Conversation

jjjhhhlll
Copy link
Contributor

Hello,
I noticed that the "required" keyword only considers the draft3 style (boolean on a property) style when used with isConstructorsRequiredPropertiesOnly() == true.

This pull-request adds support for the draft4 style ("requires" as an array of property names in object) when generating constructors with only required properties.

Thanks again for this great library.

Enjoy,
Jon

@jjjhhhlll
Copy link
Contributor Author

just noticed this one too #379. I think it is the same fix.

@joelittlejohn
Copy link
Owner

Looks like your changes include a test, so we can merge this :)

Feel free to compare your changes to #379 and tweak this if there's anything there worth taking. Let me know when your ready and I will review and merge.

Thanks for contributing!

@jjjhhhlll
Copy link
Contributor Author

I like how that one loops over the JsonNode using ArrayNode interface. It also checks that "required" items are actually textual. I'll incorporate those things.

loop using Iterable interface of JsonNode instead of using explicit iterator

check for textual members inside "required" array.
@jjjhhhlll jjjhhhlll force-pushed the array-style-required-with-constructor branch from b842c0d to 611142a Compare July 26, 2016 14:39
@jjjhhhlll
Copy link
Contributor Author

Ok. changes complete.

@joelittlejohn joelittlejohn merged commit 1c1789e into joelittlejohn:master Jul 29, 2016
@joelittlejohn joelittlejohn added this to the 0.4.24 milestone Jul 29, 2016
@joelittlejohn joelittlejohn changed the title support "required" keyword draft4 array-style when generating constru… Support "required" keyword draft04 array-style when generating constuctors Jul 29, 2016
@joelittlejohn
Copy link
Owner

Sorry, broken builds were something to do with the Sonatype oss-parent pom and an old dependency disappearing from the public apache Maven repo.

@jjjhhhlll
Copy link
Contributor Author

No worries. Maven has advantages, but they come with problems like this sometimes. Thanks for your help.

@jjjhhhlll jjjhhhlll deleted the array-style-required-with-constructor branch August 31, 2016 15:53
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.

2 participants