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

No validation on constructing objects that have required fields #65

Open
xibz opened this issue Jan 5, 2024 · 1 comment
Open

No validation on constructing objects that have required fields #65

xibz opened this issue Jan 5, 2024 · 1 comment

Comments

@xibz
Copy link

xibz commented Jan 5, 2024

If a field is required, then we should enforce it in the constructor or when calling build (if we have a builder).

/**
*
* (Required)
*
*/
@JsonProperty("id")
private String id;

But no validation

@aalmiray
Copy link
Contributor

I believe the jsonschema2pojo plugin has a setting for generating a constructor for all required fields. Be mindful that adding such constructor and removing the default one constitutes a breaking change.

cc: @afrittoli @rjalander

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