title: make one field in @RequestBody object have default value
body: <p>I have this rest service method declaration.</p>
  
  <pre><code>@PostMapping(value = "/games", consumes=MediaType.APPLICATION_JSON_VALUE)
  public ResponseEntity&lt;CreateGameResponse&gt; createGames(@RequestBody 
  CreateGameRequest req){}
  </code></pre>
  
  <p>and below is the structure of my CreateGameRequest class -</p>
  
  <pre><code>public class CreateGameRequest {
  @JsonProperty("noOfStones")
  @Value("${noOfStones:6}")
  private Integer noOfStones;
  @JsonProperty("player1Name")
  private String p1Name;
  @JsonProperty("player2Name")
  private String p2Name;
  public Integer getNoOfStones() {
      return noOfStones;
  }
  public void setNoOfStones(Integer noOfStones) {
      this.noOfStones = noOfStones;
  }
  public String getP1Name() {
      return p1Name;
  }
  public void setP1Name(String p1Name) {
      this.p1Name = p1Name;
  }
  public String getP2Name() {
      return p2Name;
  }
  public void setP2Name(String p2Name) {
      this.p2Name = p2Name;
  }
  
  
  }
  </code></pre>
  
  <p>I want field 'noOfStones' to be defaulted to value 6 if no value is passed in input. The trick i have used does not work and noOfStones is taken as null if not passed as input. What to do to give it a default value?</p>