Skip to content

Java DateTimeTypeAdapter class is not using the right formatter. #4234

@junewoo-suk

Description

@junewoo-suk
Description

DateTimeTypeAdapter class has a variable private final DateTimeFormatter formatter = ISODateTimeFormat.dateTime(); but it should be private final DateTimeFormatter formatter = ISODateTimeFormat.dateTimeParser();. For example, dates like yyyy-MM-ddTHH:mm:ssZ will not be parsable in the current version, but it will be possible with dateTimeParser function. The previous date format is a default date format from InnoDB passed to Django models

Swagger-codegen version

2.2.1

Suggest a Fix

DateTimeTypeAdapter.java
private final DateTimeFormatter formatter = ISODateTimeFormat.dateTime();
to
private final DateTimeFormatter formatter = ISODateTimeFormat.dateTimeParser();

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions