Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG][Kotlin] "date-time" type integrity violated when using default dateLibrary (java8) #20078

Open
alixwar opened this issue Nov 11, 2024 · 0 comments

Comments

@alixwar
Copy link

alixwar commented Nov 11, 2024

Description

When generating the domain model using default configuration of dateLibrary (=java8 according to https://openapi-generator.tech/docs/generators/kotlin/) the generated date-time objects are represented by java.time.OffsetDateTime.
These objects are evaluated to strings that look like this:

2024-11-08T06:54:06.831187+01:00

Date times should follow the format of RFC 3339 according to https://swagger.io/docs/specification/v3_0/data-models/data-types/#strings

In other words they should look like this:

2017-07-21T17:32:28Z

Workaround: Specify another date library, such as kotlinx-datetime which represents date-times with kotlinx.datetime.Instant

openapi-generator version

7.9.0

OpenAPI declaration file content or url
        foo:
          type: string
          format: 'date-time'
          description: Example
Generation Details

Generated using Gradle plugin

Steps to reproduce
gradlew openApiGenerate
Related issues/PRs
Suggest a fix
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant