Validating (required=true) set in JsonProperty while using ObjectMapper in Jackson should throw Exception












1














I am trying to use Jackson library for deserialization since I have a scenario wherein I have to validate for null values in many JsonProperty if it is set as required=true.



Here is the code snippet.



public class JacksonValidator {
private static final ObjectMapper MAPPER = new ObjectMapper();

public static void main(String args) {

// Should succeed since all properties have value and required=true holds good
validate("{"id": "1","age": 26,"name": "name1"}");

// Should throw exception since name is null (because of required=true)
validate("{"id": "2","age": 28,"name": null}");

// Should throw exception since id is null (because of required=true)
validate("{"id": null,"age": 27,"name": "name2"}");
}

public static void validate(String json) {

try {
Customer customer = MAPPER.readValue(json, Customer.class);
System.out.println(customer);
}
catch (IOException e) {
throw new DeserializationException(String.format("Validation failed. Unable to parse json %s", json), e);
}
}

@Setter
@Getter
@ToString
public static class Customer {
private String id;
private Integer age;
private String name;

@JsonCreator
public Customer(@JsonProperty(value = "id", required = true) String id,
@JsonProperty(value = "age", required = false) Integer age,
@JsonProperty(value = "name", required = true) String name) {
this.id = id;
this.age = age;
this.name = name;
}
}
}


As you can see in the above code, I am trying to deserialize JSON into Customer class. If the required property is set to true for a JsonProperty and while deserialization if this property encounters null(for id and name field in the above code), I have to throw a custom DeserializationException.



And also I need to have null values processed(shouldn't fail) for fields where required=false is set in JsonProperty(for age field).



Here I cannot use MAPPER.setSerializationInclusion(JsonInclude.Include.NON_NULL) since I need to process null values for required=false fields.



Please let me know how this could be achieved using ObjectMapper.readValue method or any other method that holds good here.



Any suggestions would be appreciated.










share|improve this question



























    1














    I am trying to use Jackson library for deserialization since I have a scenario wherein I have to validate for null values in many JsonProperty if it is set as required=true.



    Here is the code snippet.



    public class JacksonValidator {
    private static final ObjectMapper MAPPER = new ObjectMapper();

    public static void main(String args) {

    // Should succeed since all properties have value and required=true holds good
    validate("{"id": "1","age": 26,"name": "name1"}");

    // Should throw exception since name is null (because of required=true)
    validate("{"id": "2","age": 28,"name": null}");

    // Should throw exception since id is null (because of required=true)
    validate("{"id": null,"age": 27,"name": "name2"}");
    }

    public static void validate(String json) {

    try {
    Customer customer = MAPPER.readValue(json, Customer.class);
    System.out.println(customer);
    }
    catch (IOException e) {
    throw new DeserializationException(String.format("Validation failed. Unable to parse json %s", json), e);
    }
    }

    @Setter
    @Getter
    @ToString
    public static class Customer {
    private String id;
    private Integer age;
    private String name;

    @JsonCreator
    public Customer(@JsonProperty(value = "id", required = true) String id,
    @JsonProperty(value = "age", required = false) Integer age,
    @JsonProperty(value = "name", required = true) String name) {
    this.id = id;
    this.age = age;
    this.name = name;
    }
    }
    }


    As you can see in the above code, I am trying to deserialize JSON into Customer class. If the required property is set to true for a JsonProperty and while deserialization if this property encounters null(for id and name field in the above code), I have to throw a custom DeserializationException.



    And also I need to have null values processed(shouldn't fail) for fields where required=false is set in JsonProperty(for age field).



    Here I cannot use MAPPER.setSerializationInclusion(JsonInclude.Include.NON_NULL) since I need to process null values for required=false fields.



    Please let me know how this could be achieved using ObjectMapper.readValue method or any other method that holds good here.



    Any suggestions would be appreciated.










    share|improve this question

























      1












      1








      1







      I am trying to use Jackson library for deserialization since I have a scenario wherein I have to validate for null values in many JsonProperty if it is set as required=true.



      Here is the code snippet.



      public class JacksonValidator {
      private static final ObjectMapper MAPPER = new ObjectMapper();

      public static void main(String args) {

      // Should succeed since all properties have value and required=true holds good
      validate("{"id": "1","age": 26,"name": "name1"}");

      // Should throw exception since name is null (because of required=true)
      validate("{"id": "2","age": 28,"name": null}");

      // Should throw exception since id is null (because of required=true)
      validate("{"id": null,"age": 27,"name": "name2"}");
      }

      public static void validate(String json) {

      try {
      Customer customer = MAPPER.readValue(json, Customer.class);
      System.out.println(customer);
      }
      catch (IOException e) {
      throw new DeserializationException(String.format("Validation failed. Unable to parse json %s", json), e);
      }
      }

      @Setter
      @Getter
      @ToString
      public static class Customer {
      private String id;
      private Integer age;
      private String name;

      @JsonCreator
      public Customer(@JsonProperty(value = "id", required = true) String id,
      @JsonProperty(value = "age", required = false) Integer age,
      @JsonProperty(value = "name", required = true) String name) {
      this.id = id;
      this.age = age;
      this.name = name;
      }
      }
      }


      As you can see in the above code, I am trying to deserialize JSON into Customer class. If the required property is set to true for a JsonProperty and while deserialization if this property encounters null(for id and name field in the above code), I have to throw a custom DeserializationException.



      And also I need to have null values processed(shouldn't fail) for fields where required=false is set in JsonProperty(for age field).



      Here I cannot use MAPPER.setSerializationInclusion(JsonInclude.Include.NON_NULL) since I need to process null values for required=false fields.



      Please let me know how this could be achieved using ObjectMapper.readValue method or any other method that holds good here.



      Any suggestions would be appreciated.










      share|improve this question













      I am trying to use Jackson library for deserialization since I have a scenario wherein I have to validate for null values in many JsonProperty if it is set as required=true.



      Here is the code snippet.



      public class JacksonValidator {
      private static final ObjectMapper MAPPER = new ObjectMapper();

      public static void main(String args) {

      // Should succeed since all properties have value and required=true holds good
      validate("{"id": "1","age": 26,"name": "name1"}");

      // Should throw exception since name is null (because of required=true)
      validate("{"id": "2","age": 28,"name": null}");

      // Should throw exception since id is null (because of required=true)
      validate("{"id": null,"age": 27,"name": "name2"}");
      }

      public static void validate(String json) {

      try {
      Customer customer = MAPPER.readValue(json, Customer.class);
      System.out.println(customer);
      }
      catch (IOException e) {
      throw new DeserializationException(String.format("Validation failed. Unable to parse json %s", json), e);
      }
      }

      @Setter
      @Getter
      @ToString
      public static class Customer {
      private String id;
      private Integer age;
      private String name;

      @JsonCreator
      public Customer(@JsonProperty(value = "id", required = true) String id,
      @JsonProperty(value = "age", required = false) Integer age,
      @JsonProperty(value = "name", required = true) String name) {
      this.id = id;
      this.age = age;
      this.name = name;
      }
      }
      }


      As you can see in the above code, I am trying to deserialize JSON into Customer class. If the required property is set to true for a JsonProperty and while deserialization if this property encounters null(for id and name field in the above code), I have to throw a custom DeserializationException.



      And also I need to have null values processed(shouldn't fail) for fields where required=false is set in JsonProperty(for age field).



      Here I cannot use MAPPER.setSerializationInclusion(JsonInclude.Include.NON_NULL) since I need to process null values for required=false fields.



      Please let me know how this could be achieved using ObjectMapper.readValue method or any other method that holds good here.



      Any suggestions would be appreciated.







      java validation jackson jackson2 jackson-databind






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 27 '18 at 16:27









      DMA

      638516




      638516
























          1 Answer
          1






          active

          oldest

          votes


















          1














          You can't use @JsonProperty for null validation. It only checks whether value is present or not. From javadocs




          Property that indicates whether a value (which may be explicit null) is expected for property during deserialization or not.




          For null validation you can use Bean validation JSR-380. Hibernate example:



          Maven dependencies:



          <!-- Java bean validation API - Spec -->
          <dependency>
          <groupId>javax.validation</groupId>
          <artifactId>validation-api</artifactId>
          <version>2.0.1.Final</version>
          </dependency>

          <!-- Hibernate validator - Bean validation API Implementation -->
          <dependency>
          <groupId>org.hibernate</groupId>
          <artifactId>hibernate-validator</artifactId>
          <version>6.0.11.Final</version>
          </dependency>

          <!-- Verify validation annotations usage at compile time -->
          <dependency>
          <groupId>org.hibernate</groupId>
          <artifactId>hibernate-validator-annotation-processor</artifactId>
          <version>6.0.11.Final</version>
          </dependency>

          <!-- Unified Expression Language - Spec -->
          <dependency>
          <groupId>javax.el</groupId>
          <artifactId>javax.el-api</artifactId>
          <version>3.0.1-b06</version>
          </dependency>

          <!-- Unified Expression Language - Implementation -->
          <dependency>
          <groupId>org.glassfish.web</groupId>
          <artifactId>javax.el</artifactId>
          <version>2.2.6</version>
          </dependency>


          Then you can use it like:



          ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
          Validator validator = factory.getValidator();
          Set<ConstraintViolation<Customer>> constraintViolations = validator.validate(customer);
          if (constraintViolations.size() > 0) {
          throw new DeserializationException(String.format("Validation failed. Unable to parse json %s", json), e);
          }





          share|improve this answer





















          • thanks for your reply. I don't think Bean Validation works for @JsonProperty or any other Jackson Annotations. It only works for fields with javax.validation.* for eg annotations marked with @NotNull etc. I tried this out sometime back too. In my case, I can't change the Customer class at all. That is how it would be generated and I have to use it
            – DMA
            yesterday










          • @DMA You're right it only works for javax.validation.* JSR-380. If you can't change Customer class, I think you should try with reflection or some annotation processor validator, if performance is crucial.
            – Sukhpal Singh
            yesterday












          • Thanks again for your reply @SukhpalSingh. Yes, you are right. Here performance is crucial too. Yes, one option as you mentioned is with reflection. Is there any other way of doing it? Is it possible to create a schema out of this Customer class for eg and then validate it with Jackson or any other library?
            – DMA
            yesterday











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53948026%2fvalidating-required-true-set-in-jsonproperty-while-using-objectmapper-in-jacks%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          You can't use @JsonProperty for null validation. It only checks whether value is present or not. From javadocs




          Property that indicates whether a value (which may be explicit null) is expected for property during deserialization or not.




          For null validation you can use Bean validation JSR-380. Hibernate example:



          Maven dependencies:



          <!-- Java bean validation API - Spec -->
          <dependency>
          <groupId>javax.validation</groupId>
          <artifactId>validation-api</artifactId>
          <version>2.0.1.Final</version>
          </dependency>

          <!-- Hibernate validator - Bean validation API Implementation -->
          <dependency>
          <groupId>org.hibernate</groupId>
          <artifactId>hibernate-validator</artifactId>
          <version>6.0.11.Final</version>
          </dependency>

          <!-- Verify validation annotations usage at compile time -->
          <dependency>
          <groupId>org.hibernate</groupId>
          <artifactId>hibernate-validator-annotation-processor</artifactId>
          <version>6.0.11.Final</version>
          </dependency>

          <!-- Unified Expression Language - Spec -->
          <dependency>
          <groupId>javax.el</groupId>
          <artifactId>javax.el-api</artifactId>
          <version>3.0.1-b06</version>
          </dependency>

          <!-- Unified Expression Language - Implementation -->
          <dependency>
          <groupId>org.glassfish.web</groupId>
          <artifactId>javax.el</artifactId>
          <version>2.2.6</version>
          </dependency>


          Then you can use it like:



          ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
          Validator validator = factory.getValidator();
          Set<ConstraintViolation<Customer>> constraintViolations = validator.validate(customer);
          if (constraintViolations.size() > 0) {
          throw new DeserializationException(String.format("Validation failed. Unable to parse json %s", json), e);
          }





          share|improve this answer





















          • thanks for your reply. I don't think Bean Validation works for @JsonProperty or any other Jackson Annotations. It only works for fields with javax.validation.* for eg annotations marked with @NotNull etc. I tried this out sometime back too. In my case, I can't change the Customer class at all. That is how it would be generated and I have to use it
            – DMA
            yesterday










          • @DMA You're right it only works for javax.validation.* JSR-380. If you can't change Customer class, I think you should try with reflection or some annotation processor validator, if performance is crucial.
            – Sukhpal Singh
            yesterday












          • Thanks again for your reply @SukhpalSingh. Yes, you are right. Here performance is crucial too. Yes, one option as you mentioned is with reflection. Is there any other way of doing it? Is it possible to create a schema out of this Customer class for eg and then validate it with Jackson or any other library?
            – DMA
            yesterday
















          1














          You can't use @JsonProperty for null validation. It only checks whether value is present or not. From javadocs




          Property that indicates whether a value (which may be explicit null) is expected for property during deserialization or not.




          For null validation you can use Bean validation JSR-380. Hibernate example:



          Maven dependencies:



          <!-- Java bean validation API - Spec -->
          <dependency>
          <groupId>javax.validation</groupId>
          <artifactId>validation-api</artifactId>
          <version>2.0.1.Final</version>
          </dependency>

          <!-- Hibernate validator - Bean validation API Implementation -->
          <dependency>
          <groupId>org.hibernate</groupId>
          <artifactId>hibernate-validator</artifactId>
          <version>6.0.11.Final</version>
          </dependency>

          <!-- Verify validation annotations usage at compile time -->
          <dependency>
          <groupId>org.hibernate</groupId>
          <artifactId>hibernate-validator-annotation-processor</artifactId>
          <version>6.0.11.Final</version>
          </dependency>

          <!-- Unified Expression Language - Spec -->
          <dependency>
          <groupId>javax.el</groupId>
          <artifactId>javax.el-api</artifactId>
          <version>3.0.1-b06</version>
          </dependency>

          <!-- Unified Expression Language - Implementation -->
          <dependency>
          <groupId>org.glassfish.web</groupId>
          <artifactId>javax.el</artifactId>
          <version>2.2.6</version>
          </dependency>


          Then you can use it like:



          ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
          Validator validator = factory.getValidator();
          Set<ConstraintViolation<Customer>> constraintViolations = validator.validate(customer);
          if (constraintViolations.size() > 0) {
          throw new DeserializationException(String.format("Validation failed. Unable to parse json %s", json), e);
          }





          share|improve this answer





















          • thanks for your reply. I don't think Bean Validation works for @JsonProperty or any other Jackson Annotations. It only works for fields with javax.validation.* for eg annotations marked with @NotNull etc. I tried this out sometime back too. In my case, I can't change the Customer class at all. That is how it would be generated and I have to use it
            – DMA
            yesterday










          • @DMA You're right it only works for javax.validation.* JSR-380. If you can't change Customer class, I think you should try with reflection or some annotation processor validator, if performance is crucial.
            – Sukhpal Singh
            yesterday












          • Thanks again for your reply @SukhpalSingh. Yes, you are right. Here performance is crucial too. Yes, one option as you mentioned is with reflection. Is there any other way of doing it? Is it possible to create a schema out of this Customer class for eg and then validate it with Jackson or any other library?
            – DMA
            yesterday














          1












          1








          1






          You can't use @JsonProperty for null validation. It only checks whether value is present or not. From javadocs




          Property that indicates whether a value (which may be explicit null) is expected for property during deserialization or not.




          For null validation you can use Bean validation JSR-380. Hibernate example:



          Maven dependencies:



          <!-- Java bean validation API - Spec -->
          <dependency>
          <groupId>javax.validation</groupId>
          <artifactId>validation-api</artifactId>
          <version>2.0.1.Final</version>
          </dependency>

          <!-- Hibernate validator - Bean validation API Implementation -->
          <dependency>
          <groupId>org.hibernate</groupId>
          <artifactId>hibernate-validator</artifactId>
          <version>6.0.11.Final</version>
          </dependency>

          <!-- Verify validation annotations usage at compile time -->
          <dependency>
          <groupId>org.hibernate</groupId>
          <artifactId>hibernate-validator-annotation-processor</artifactId>
          <version>6.0.11.Final</version>
          </dependency>

          <!-- Unified Expression Language - Spec -->
          <dependency>
          <groupId>javax.el</groupId>
          <artifactId>javax.el-api</artifactId>
          <version>3.0.1-b06</version>
          </dependency>

          <!-- Unified Expression Language - Implementation -->
          <dependency>
          <groupId>org.glassfish.web</groupId>
          <artifactId>javax.el</artifactId>
          <version>2.2.6</version>
          </dependency>


          Then you can use it like:



          ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
          Validator validator = factory.getValidator();
          Set<ConstraintViolation<Customer>> constraintViolations = validator.validate(customer);
          if (constraintViolations.size() > 0) {
          throw new DeserializationException(String.format("Validation failed. Unable to parse json %s", json), e);
          }





          share|improve this answer












          You can't use @JsonProperty for null validation. It only checks whether value is present or not. From javadocs




          Property that indicates whether a value (which may be explicit null) is expected for property during deserialization or not.




          For null validation you can use Bean validation JSR-380. Hibernate example:



          Maven dependencies:



          <!-- Java bean validation API - Spec -->
          <dependency>
          <groupId>javax.validation</groupId>
          <artifactId>validation-api</artifactId>
          <version>2.0.1.Final</version>
          </dependency>

          <!-- Hibernate validator - Bean validation API Implementation -->
          <dependency>
          <groupId>org.hibernate</groupId>
          <artifactId>hibernate-validator</artifactId>
          <version>6.0.11.Final</version>
          </dependency>

          <!-- Verify validation annotations usage at compile time -->
          <dependency>
          <groupId>org.hibernate</groupId>
          <artifactId>hibernate-validator-annotation-processor</artifactId>
          <version>6.0.11.Final</version>
          </dependency>

          <!-- Unified Expression Language - Spec -->
          <dependency>
          <groupId>javax.el</groupId>
          <artifactId>javax.el-api</artifactId>
          <version>3.0.1-b06</version>
          </dependency>

          <!-- Unified Expression Language - Implementation -->
          <dependency>
          <groupId>org.glassfish.web</groupId>
          <artifactId>javax.el</artifactId>
          <version>2.2.6</version>
          </dependency>


          Then you can use it like:



          ValidatorFactory factory = Validation.buildDefaultValidatorFactory();
          Validator validator = factory.getValidator();
          Set<ConstraintViolation<Customer>> constraintViolations = validator.validate(customer);
          if (constraintViolations.size() > 0) {
          throw new DeserializationException(String.format("Validation failed. Unable to parse json %s", json), e);
          }






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 28 '18 at 8:53









          Sukhpal Singh

          869110




          869110












          • thanks for your reply. I don't think Bean Validation works for @JsonProperty or any other Jackson Annotations. It only works for fields with javax.validation.* for eg annotations marked with @NotNull etc. I tried this out sometime back too. In my case, I can't change the Customer class at all. That is how it would be generated and I have to use it
            – DMA
            yesterday










          • @DMA You're right it only works for javax.validation.* JSR-380. If you can't change Customer class, I think you should try with reflection or some annotation processor validator, if performance is crucial.
            – Sukhpal Singh
            yesterday












          • Thanks again for your reply @SukhpalSingh. Yes, you are right. Here performance is crucial too. Yes, one option as you mentioned is with reflection. Is there any other way of doing it? Is it possible to create a schema out of this Customer class for eg and then validate it with Jackson or any other library?
            – DMA
            yesterday


















          • thanks for your reply. I don't think Bean Validation works for @JsonProperty or any other Jackson Annotations. It only works for fields with javax.validation.* for eg annotations marked with @NotNull etc. I tried this out sometime back too. In my case, I can't change the Customer class at all. That is how it would be generated and I have to use it
            – DMA
            yesterday










          • @DMA You're right it only works for javax.validation.* JSR-380. If you can't change Customer class, I think you should try with reflection or some annotation processor validator, if performance is crucial.
            – Sukhpal Singh
            yesterday












          • Thanks again for your reply @SukhpalSingh. Yes, you are right. Here performance is crucial too. Yes, one option as you mentioned is with reflection. Is there any other way of doing it? Is it possible to create a schema out of this Customer class for eg and then validate it with Jackson or any other library?
            – DMA
            yesterday
















          thanks for your reply. I don't think Bean Validation works for @JsonProperty or any other Jackson Annotations. It only works for fields with javax.validation.* for eg annotations marked with @NotNull etc. I tried this out sometime back too. In my case, I can't change the Customer class at all. That is how it would be generated and I have to use it
          – DMA
          yesterday




          thanks for your reply. I don't think Bean Validation works for @JsonProperty or any other Jackson Annotations. It only works for fields with javax.validation.* for eg annotations marked with @NotNull etc. I tried this out sometime back too. In my case, I can't change the Customer class at all. That is how it would be generated and I have to use it
          – DMA
          yesterday












          @DMA You're right it only works for javax.validation.* JSR-380. If you can't change Customer class, I think you should try with reflection or some annotation processor validator, if performance is crucial.
          – Sukhpal Singh
          yesterday






          @DMA You're right it only works for javax.validation.* JSR-380. If you can't change Customer class, I think you should try with reflection or some annotation processor validator, if performance is crucial.
          – Sukhpal Singh
          yesterday














          Thanks again for your reply @SukhpalSingh. Yes, you are right. Here performance is crucial too. Yes, one option as you mentioned is with reflection. Is there any other way of doing it? Is it possible to create a schema out of this Customer class for eg and then validate it with Jackson or any other library?
          – DMA
          yesterday




          Thanks again for your reply @SukhpalSingh. Yes, you are right. Here performance is crucial too. Yes, one option as you mentioned is with reflection. Is there any other way of doing it? Is it possible to create a schema out of this Customer class for eg and then validate it with Jackson or any other library?
          – DMA
          yesterday


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53948026%2fvalidating-required-true-set-in-jsonproperty-while-using-objectmapper-in-jacks%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Monofisismo

          Angular Downloading a file using contenturl with Basic Authentication

          Olmecas