{"repo":"icerockdev/moko-network","free":true,"listed":false,"github":"https://github.com/icerockdev/moko-network","clone":"git clone https://github.com/icerockdev/moko-network.git","description":"OpenAPI client code generation for mobile (android & ios) Kotlin Multiplatform development","language":"Kotlin","stars":154,"topics":["android","ios","kotlin-native","kotlin-multiplatform","moko","ktor-client","openapi","gradle-plugin","serialization","coroutines"],"license":"Apache-2.0","category":"mobile-apps","readme_excerpt":"Mobile Kotlin network components This is a Kotlin MultiPlatform library that provide network components for iOS & Android. Library is addition to ktor-client with gradle plugin to generate entities and api classes from OpenAPI (Swagger) specification file. Entities serialization done by kotlinx.serialization. Table of Contents - Features - Requirements - Installation - Usage - Samples - Set Up Locally - Contributing - License Features - OpenAPI client code generation - just configure plugin then use generated entities and api classes; - TokenFeature feature to ktor-client with auth token header support; - ExceptionFeature feature to ktor-client that parse errors from server to domain exceptions. - RefreshTokenFeature feature to ktor-client that handle Unauthorized response from server, try to update token and repeat failed request in case, when token update was successful; Requirements - Gradle version 6.8+ - Android API 16+ - iOS version 11.0+ Installation root build.gradle project build.gradle Usage 1. E.g. put an OpenAPI Specification file to src/swagger.json path of the project Gradle module. 2. Setup the project build.gradle : 3. Then run openApiGenerate Gradle task and after completion you will get all generated classes in build/generated/moko-network directory. 4. To import all generated classes of model put: 5. Then you can use generated API's in your application in the common sourceset: For the moko-network specification generator, you can enable safe enum properties","default_branch":null,"files":null,"tree":[],"storefront":"/r/icerockdev","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/icerockdev/moko-network/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}