You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This might be an optional setting which probably needs to be defined in the generator config. I could not find anything in openapi itself that would suggest that value classes are supported.
If an openapi defined object has one single attribute of a primitive type (+String), a value class can and should be generated. The name should be derivable from the openapi definition.
Street:
type: object
required:
- name
properties:
name:
type: string
description: "The name of the street as part of an address"
could be generated as
@JvmInline value class Street(val name: String)
What do you think?
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
It would make code safer and easier to read if a Kotlin generator would support the generation of value classes if applicable.
See https://kotlinlang.org/docs/inline-classes.html for Kotlin value class details
Describe the solution you'd like
This might be an optional setting which probably needs to be defined in the generator config. I could not find anything in openapi itself that would suggest that value classes are supported.
If an openapi defined object has one single attribute of a primitive type (+String), a value class can and should be generated. The name should be derivable from the openapi definition.
could be generated as
@JvmInline value class Street(val name: String)
What do you think?
The text was updated successfully, but these errors were encountered: