{"id":19774233,"url":"https://github.com/materiiapps/partial-kt","last_synced_at":"2025-06-20T16:11:06.748Z","repository":{"id":65820229,"uuid":"570715677","full_name":"MateriiApps/partial-kt","owner":"MateriiApps","description":"A Kotlin KSP plugin for generating partial variants of classes.","archived":false,"fork":false,"pushed_at":"2023-11-08T23:05:56.000Z","size":209,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-21T00:56:49.944Z","etag":null,"topics":["codegen","kotlin","ksp","partials"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MateriiApps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-11-25T22:51:36.000Z","updated_at":"2023-11-13T08:13:36.000Z","dependencies_parsed_at":"2023-03-18T00:15:31.153Z","dependency_job_id":null,"html_url":"https://github.com/MateriiApps/partial-kt","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MateriiApps%2Fpartial-kt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MateriiApps%2Fpartial-kt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MateriiApps%2Fpartial-kt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MateriiApps%2Fpartial-kt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MateriiApps","download_url":"https://codeload.github.com/MateriiApps/partial-kt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224219555,"owners_count":17275477,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codegen","kotlin","ksp","partials"],"created_at":"2024-11-12T05:12:18.000Z","updated_at":"2024-11-12T05:12:18.611Z","avatar_url":"https://github.com/MateriiApps.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# partial-kt\n\nA Kotlin KSP plugin for generating partial variants of classes.\n\n## Installation\n\n```kt\nplugins {\n    id(\"com.google.devtools.ksp\") version \"1.9.20-1.0.14\"\n}\n\nrepositories {\n    mavenCentral()\n}\n\ndependencies {\n    implementation(\"io.github.materiiapps:partial:1.2.0\")\n    ksp(\"io.github.materiiapps:partial-ksp:1.2.0\")\n}\n\nkotlin {\n    sourceSets {\n        getByName(\"main\") {\n            kotlin.srcDir(\"build/generated/ksp/main/kotlin\")\n        }\n    }\n}\n```\n\n## Usage\n\nMark your target classes with `@Partialize`, then trigger a build to generate the partial classes for them to appear in\nintellisense. The generated file will have the following:\n\n- A class named `[name]Partial` extending `Partial\u003cT=full type\u003e`\n- `Partial\u003cT\u003e#merge(T)` for merging generic partials with a full class\n- `[name].toPartial()` for converting a full class to a partial\n- `[name].merge(partial)` for merging a full class with a partial\n\nA single interface and direct implementations of it **are** supported, for a limited hierarchy.\nMark your interface with `@Partialize(children = [Implementation::class])`, noting that the implementation has to extend\nthe interface (obviously).\n\nYou can mark a property with (supported on interfaces too):\n\n- `@Required` - To make the field not be boxed in a partial (required upon deserializing)\n- `@Skip` - Omits the field from being generated in the partial class (requires default value\n\n### Example\n\nFor a full example, please refer to the testing\nfile [here](./example/src/main/kotlin/com/github/materiiapps/partial/example/Data.kt).\n\nBasic serializable class example:\n\n```kt\n@Partialize\n@Serializable // Custom annotations are preserved\ndata class User(\n    val name: String,\n    val age: Int,\n\n    @SerialName(\"parent_age\") // Fields annotations are also preserved\n    val parentAge: Int\n)\n\nfun main() {\n    val gregory14 = User(name = \"Gregory\", age = 14, parentAge = 36)\n    val mariaNoAge = UserPartial(name = Partial.Value(\"maria\"))\n    val merged = mariaNoAge.merge(gregory14)\n    println(merged)\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmateriiapps%2Fpartial-kt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmateriiapps%2Fpartial-kt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmateriiapps%2Fpartial-kt/lists"}