# Creating a simple Kotlin Multiplatform project based on moko-template -- part 2

DevFeed: [Creating a simple Kotlin Multiplatform project based on moko-template -- part 2](<https://devfeed.tech/articles/creating-a-simple-kotlin-multiplatform-project-based-on-moko-template-part-2-24582.md>)

Original publisher: [Read original article](<https://medium.com/icerock/creating-a-simple-kotlin-multiplatform-project-based-on-moko-template-part-2-4444ca710709?source=rss-2f461fccc401------2>)

Author: IceRock Development

Published: 2019-11-17T12:05:17Z

Content type: tutorial

Language: en

Sources: [Stories by IceRock Development on Medium](<https://devfeed.tech/sources/stories-by-icerock-development-on-medium.md>)

Topics: [Kotlin Multiplatform](<https://devfeed.tech/topics/kotlin-multiplatform.md>), [Template](<https://devfeed.tech/topics/template.md>), [OpenAPI Specification](<https://devfeed.tech/topics/openapi.md>), [API](<https://devfeed.tech/topics/api.md>), [Gradle](<https://devfeed.tech/topics/gradle.md>), [Library](<https://devfeed.tech/topics/library.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [gradle](<https://devfeed.tech/tags/gradle.md>), [ios](<https://devfeed.tech/tags/ios.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [ktor](<https://devfeed.tech/tags/ktor.md>), [multiplatform](<https://devfeed.tech/tags/multiplatform.md>), [openapi-specification](<https://devfeed.tech/tags/openapi-specification.md>), [project](<https://devfeed.tech/tags/project.md>), [serialization](<https://devfeed.tech/tags/serialization.md>), [software-development](<https://devfeed.tech/tags/software-development.md>)

## AI overview

A tutorial showing how to build the second part of a GiphyApp series with Kotlin Multiplatform and the moko-template. It explains replacing a News API example with the GIPHY service by updating the OpenAPI specification, generated code, domain models, repository, and dependencies.

## Source excerpt

Creating a simple Kotlin Multiplatform project based on moko-template -- part 21. Intro This manual is the second part in GiphyApp series, before you start we would recommend to do GiphyApp #1. The result of this lession is available on github. 2. Implement common logic of Gif list in shared library App should get list of Gifs from GIPHY service. There is an example with getting list of news from newsapi in the project template (using moko-network with generating network entites and API classes from OpenAPI specification). We can get OpenAPI spec of GIPHY from apis.guru and can replace getting news by getting Gif. Feature List is already in the project template and you have not to implement any additional logic. You can see scheme of module and look into mpp-library:feature:list for detail information about it. Replace OpenAPI spec Replace file mpp-library/domain/src/openapi.yml by the content from OpenAPI spec of GIPHY service. After it please do Gradle Sync and as the result you will see some errors in the newsapi code. Let's update code by new API. You can find generated files here mpp-library/domain/build/generate-resources/main/src/main/kotlin Replace news by gifs in domain module You have to update the following classes after replacing OpenAPI spec in domain module: News should be replaced by Gif; NewsRepository - should be replaced by GifRepository; DomainFactory - add gifRepository and set necessary dependencies. News -> Gif Let's modify News class to the following one: @Parcelize data class Gif( val id: Int, val previewUrl: String, val sourceUrl: String ) : Parcelable This domain entity contains gif's id and two URL (full and preview variant). id is used for correct identifying element in a list and in UI animations. Let's transform network entity dev.icerock.moko.network.generated.models.Gif to domain entity. To do this add one more construct method: @Parcelize data class Gif( ... ) : Parcelable { internal constructor(entity: dev.icerock.moko.network.genera