Skip to content

Add 'formatDates' config option to add JsonFormat annotation on format "date" fields #699

@CheeseE

Description

@CheeseE

I have some date fields defined as following:

        "effectiveDate": {
          "type": "string",
          "format": "date",
          "customDateTimePattern": "yyyy-MM-dd"
        }

In my maven plugin I've configured the plugin to use java.time.* for date fields as following:

    <configuration>
      <dateTimeType>java.time.LocalDateTime</dateTimeType>
      <dateType>java.time.LocalDate</dateType>
     </configuration>

After generating the classes the jsonFormat annotation is not applied to the classes:

    @JsonProperty("effectiveDate")
    private LocalDate effectiveDate;

Because of this all the date fields are serialized as array of integers.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions