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 at generator of request parameters with Nullable type #157

Open Tetraquark opened 3 years ago

Tetraquark commented 3 years ago

Need to add support to the network-generator of nullable parameters of a request.

In spec:

paths:
  /users:
    get:
      parameters:
        - name: "client_id"
          in: "query"
          schema:
            type: string
            nullable: true
          required: true
      summary: Returns a list of users.
      description: Optional extended description in CommonMark or HTML.

Generator should create code like this:

override public open suspend fun users(client_id: dev.icerock.moko.network.nullable.Nullable<kotlin.String>) : Unit