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

Kotlin date and datetime types are generated as strings from json schema #2460

Open
nick-ikea opened this issue Jan 3, 2024 · 0 comments
Open

Comments

@nick-ikea
Copy link

Kotlin generated data classes use string instead of date or datetime
Here is the part of the schema:
"properties": {
"PlannedDateTime" : {
"type" : "string",
"format" : "date-time",
"examples" : [ "2020-02-03T08:00:00.000+01:00" ],
"description" : "When the planing process is finished, this timestamp is set and never changed afterwards (frozen value). It is expressed as a local time plus timezone offset, so UTC can be derived by a simple calculation."
},
"pokemon": {
"type": "array",
"description": "All pokémon contained in the pokédex",
"items": {
"$ref": "#/definitions/Pokemon"
}

    }
  },

Generated result is:

data class PokedexSchema (
/**
* When the planing process is finished, this timestamp is set and never changed afterwards
* (frozen value). It is expressed as a local time plus timezone offset, so UTC can be
* derived by a simple calculation.
*/
val plannedDateTime: String,

/**
 * All pokémon contained in the pokédex
 */
val pokemon: List<Pokemon>

)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant