title: Spring Boot Jackson mappings are not working
body: <p>I am using fasterxml jackson for json serialization. I have written date serializer as </p>
  
  <pre><code>public class DateObjectSerializer extends JsonSerializer&lt;Date&gt; {
      public static final String DATE_FORMAT = "dd.MM.yyyy";
  
      @Override
      public void serialize(Date date, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException {
          System.out.println("From DateObjectSerializer");
          SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT);
          String formattedDate = dateFormat.format(date);
          jgen.writeString(formattedDate);
      }
  }
  </code></pre>
  
  <p>But it is not being invoked. However other Jackson Serializers are working fine.</p>
  
  <p>So I added following configuration in application.yaml</p>
  
  <pre><code>spring:
    jackson:
      serialization-inclusion: non_null
      date-format: dd.MM.yyyy
  </code></pre>
  
  <p>But it din't work.</p>
  
  <p>So I have added this code in SpringBootConfiguration class.</p>
  
  <pre><code>@Override
  public void configureMessageConverters(List&lt;HttpMessageConverter&lt;?&gt;&gt; converters) {
      final MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();
      final ObjectMapper objectMapper = new ObjectMapper();
      SimpleDateFormat dateFormat = new SimpleDateFormat(DATE_FORMAT);
      objectMapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false).setDateFormat(dateFormat);
      converter.setObjectMapper(objectMapper);
      converters.add(converter);
      super.configureMessageConverters(converters);
  }
  </code></pre>
  
  <p>Now dates are being serialized correctly. But now valid JSON equivalent strings are not being transformed to JSON as mentioned <a href="https://stackoverflow.com/q/30895286/453767">here</a>.</p>
  
  <pre><code>@RestController
  public class SampleController {
  
      @RequestMapping(value = "/jsonInfo", method = RequestMethod.GET, produces = APPLICATION_JSON_VALUE)
      public String jsonInfo() {
          String string = "{\"name\": \"foo\"}"
                  return string;
      }
  }
  </code></pre>