icerockdev / moko-network

Network components with codegeneration of rest api for mobile (android & ios) Kotlin Multiplatform development
https://moko.icerock.dev
Apache License 2.0
151 stars 29 forks source link

Support for oneOf in openapi generator #83

Closed Tetraquark closed 3 years ago

Tetraquark commented 3 years ago

Need to implement supporting oneOf constructions like this:

User:
  type: object
  properties:
    birth_date:
      oneOf:
      - $ref: "#/components/schemas/UserBirthday"
      - description: Дата рождения
          type: string
          format: date
Alex009 commented 3 years ago

Go try to implement it as JsonElement in output:

@Serializable
data class User(
    @SerialName("birth_date")
    val birthDate: JsonElement
)

and in consumer app this field will be read in runtime

Alex009 commented 3 years ago

will be available in 0.11.0