openapi-processor / openapi-processor-spring

an OpenAPI 3.0 & 3.1 interface & model java code generator for Spring Boot
https://docs.openapiprocessor.io
Apache License 2.0
40 stars 9 forks source link

string:date-time type mapping is not generating with specified type #270

Closed mjparme closed 5 months ago

mjparme commented 5 months ago

Using 2024.3 of the spring processor I have this in an OpenAPI spec:

"startDate": {
    "type": "string",
    "format": "date-time"
},

I have this in my mapping.yml:

types:
  - type: string:date-time => java.time.LocalDate

But is is still generating with OffsetDateTime:

    @JsonProperty("startDate")
    OffsetDateTime startDate,

With this version of the base plugin:

plugins {
    id 'io.openapiprocessor.openapi-processor' version '2023.2'
}
mjparme commented 5 months ago

nevermind, looks like there is supposed to be a map: key as a parent of types:. That wasn't shown in the examples. (it is on the type mapping structure page though...might be handy to have it in the examples though)

map:
  types:
    - type: