title: Why is Spring Boot and MongoRepository findById(...) setting my integer keys to 0?
body: <p>I currently have a MongoRepository with a REST interface that is performing basic CRUD. Everything works for the object, except for one <code>int</code> field. When I look at the object in Mongo itself, using <code>db.collection.find()</code>, I see the following representation:</p>
  
  <pre><code>{
      "_id" : "test1",
      "title" : "test1",
      "description" : "Adam's Api Root",
      "versions" : [
          "version 1",
          "version 2"
      ],
      "max_content_length" : 50000
  }
  </code></pre>
  
  <p>Note <code>"max_content_length" : 50000</code>.</p>
  
  <p>The following call is made to retrieve this object from the database:</p>
  
  <pre><code>ApiRootDocument apiRoot = apiRootsRepository.findById(id);
  </code></pre>
  
  <p>When my query is performed, and I look at my debugger, the object has all of the key-values set appropriately, except for <code>max_content_length</code>, which is set to 0, always. </p>
  
  <p>The REST response looks like:</p>
  
  <pre><code>{
      "title": "test1",
      "description": "Adam's Api Root",
      "versions": [
          "version 1",
          "version 2"
      ],
      "max_content_length": 0
  }
  </code></pre>
  
  <p>I am thinking this has something to do with variable naming, getters and setters, etc.</p>
  
  <p>I'm using Gson for plain serialization/deserialization (though not custom conversion to/from Mongo), and the ApiRoot object declares the <code>max_content_length</code> field like so:</p>
  
  <pre><code>@Expose
  @SerializedName("max_content_length")
  private int maxContentLength;
  </code></pre>
  
  <p>I'm assuming the problem is related to the way I have the field declared, but I would like to avoid using Spring Data annotations on this field, as the objects are in a separate API.</p>
  
  <p>What am I missing to get this 'int' field to read correctly?</p>