title: Generating correct swagger spec for Java LocalDateTime
body: <p>I am trying to get swagger spec(yaml) from Java code using Swagger Annotations in a spring boot application. I annotate the models and then run the springboot app and then get the spec from <a href="http://localhost:8080/v2/api-docs" rel="noreferrer">http://localhost:8080/v2/api-docs</a>.</p>
  
  <p>My Model Looks like below  : </p>
  
  <pre><code>package com.indiana.core;
  import java.time.LocalDateTime;
  import com.fasterxml.jackson.annotation.JsonFormat;
  import com.fasterxml.jackson.annotation.JsonProperty;
  
  import io.swagger.annotations.ApiModelProperty;
  
  @lombok.ToString
  @lombok.Getter
  @lombok.Setter
  public class SampleClass{
  
          @JsonProperty(value = "birth_date_time")
      private LocalDateTime birthDateTime;
  ....
  }'
  </code></pre>
  
  <p>I want to create correct swagger yaml speck for this. I expect the below when I access swagger UI which provides the yaml automatically .</p>
  
  <p>Note that dateOfBirth is a Java 8 LocalDateTime class . But as per swagger spec(<a href="https://swagger.io/specification/" rel="noreferrer">https://swagger.io/specification/</a> look for Data Types Sections ) the Date in yaml should be type : 'string' and format: date-time.</p>
  
  <pre><code> 'SampleClass:
      properties:
        dateOfBirth:
          type: string
          format: date-time'
  </code></pre>
  
  <p>What I am getting now  : </p>
  
  <p>It looks like swagger is building a detailed definition LocalDateTime, which is not I am looking for .</p>
  
  <pre><code>'"definitions": {
          "LocalDateTime": {
              "type": "object",
              "properties": {
                  "chronology": {
                      "$ref": "#/definitions/Chronology"
                  },
                  "dayOfMonth": {
                      "type": "integer",
                      "format": "int32"
                  },
                  "dayOfWeek": {
                      "type": "string",
                      "enum": ["MONDAY", "TUESDAY", "WEDNESDAY", "THURSDAY", "FRIDAY", "SATURDAY", "SUNDAY"]
                  },
                  "dayOfYear": {
                      "type": "integer",
                      "format": "int32"
                  },
                  "hour": {
                      "type": "integer",
                      "format": "int32"
                  },
                  "minute": {
                      "type": "integer",
                      "format": "int32"
                  },
                  "month": {
                      "type": "string",
                      "enum": ["JANUARY", "FEBRUARY", "MARCH", "APRIL", "MAY", "JUNE", "JULY", "AUGUST", "SEPTEMBER", "OCTOBER", "NOVEMBER", "DECEMBER"]
                  },
                  "monthValue": {
                      "type": "integer",
                      "format": "int32"
                  },
                  "nano": {
                      "type": "integer",
                      "format": "int32"
                  },
                  "second": {
                      "type": "integer",
                      "format": "int32"
                  },
                  "year": {
                      "type": "integer",
                      "format": "int32"
                  }
              }
          },
  </code></pre>
  
  <p>I have tried with </p>
  
  <pre><code>'A. @ApiModelProperty(dataType = "java.lang.String", example = "17-03-2019 22:18:59", notes = "Birthdaytime desc")
  B. @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "MM-dd-yyyy hh:mm:ss")'
  </code></pre>
  
  <p>Out these for A , the element is defined as string only in the yaml , the 'format: date-time' is missing like below .</p>
  
  <pre><code> SampleClass:
      properties:
        dateOfBirth:
          type: string
  </code></pre>
  
  <p>What tweaking is needed to create aperfect swegger for this ?
  I need this </p>
  
  <pre><code> SampleClass:
      properties:
        dateOfBirth:
          type: string
          format: date-time .
  </code></pre>