Skip to content

No validation on constructing objects that have required fields #65

Open

Description

@xibz

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

Activity

  1. aalmiray commented on Feb 28, 2024

    @aalmiray
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions