title: SpringBoot Consuming REST variable binding
body: <p>I am following this tutorial: <a href="https://spring.io/guides/gs/consuming-rest/" rel="nofollow">https://spring.io/guides/gs/consuming-rest/</a>
  It is consuming a JSON object, like this one:</p>
  
  <pre><code>{
     type: "success",
     value: {
        id: 10,
        quote: "Really loving Spring Boot, makes stand alone Spring apps easy."
     }
  }
  </code></pre>
  
  <p>I have one question. In Value.java, we have two variables:</p>
  
  <pre><code>  private Long id;
    private String quote;
  </code></pre>
  
  <p>My question is how does Spring know to bind the variable id to the id property in JSON and how does it know to bind quote variable to the quote property in JSON. I tried making both String thinking that maybe Spring auto determines the data-type of a variable and then does the binding but that didn't make a difference. I thought maybe if the variable names are same as the property, that's how it does the binding, so I tried changing the variable names and that didn't make a difference either. Then I thought it is maybe the order of the variables so I switched the variables so it became like this:</p>
  
  <pre><code>  private String quote;
    private String id;
  </code></pre>
  
  <p>I made them both String on purpose. But still somehow the id property was getting binded to the variable id and quote property to quote variable. </p>
  
  <p>So could someone tell me like how does Spring determine which property to bind to which variable.</p>