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 not required but nullable properties #82

Closed Alex009 closed 3 years ago

Alex009 commented 3 years ago

To use Json encodingDefaults https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/json.md#encoding-defaults feature for PUT requests where we should not send arguments that not change value - we should use default null only in case where parameter is required and nullable: true, or not required.

Alex009 commented 3 years ago

required: true, nullable: true -> optional, without default required: true, nullable: false -> not optional, without default

required: false, nullable: true -> optional, default = null required: false, nullable: false -> not optional, with default (where we got default?)

Alex009 commented 3 years ago

will be available in 0.11.0