{"id":37018614,"url":"https://github.com/vlprojects/convertible","last_synced_at":"2026-01-14T02:01:03.123Z","repository":{"id":294458163,"uuid":"979343852","full_name":"VLprojects/convertible","owner":"VLprojects","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-20T14:06:22.000Z","size":77,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-20T14:44:00.992Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/VLprojects.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-07T11:20:20.000Z","updated_at":"2025-05-20T14:05:56.000Z","dependencies_parsed_at":"2025-05-20T14:44:11.155Z","dependency_job_id":"551423db-a67c-4615-a9a9-dd2f85f1033e","html_url":"https://github.com/VLprojects/convertible","commit_stats":null,"previous_names":["vlprojects/convertible"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/VLprojects/convertible","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VLprojects%2Fconvertible","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VLprojects%2Fconvertible/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VLprojects%2Fconvertible/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VLprojects%2Fconvertible/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VLprojects","download_url":"https://codeload.github.com/VLprojects/convertible/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VLprojects%2Fconvertible/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408709,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2026-01-14T02:00:41.932Z","updated_at":"2026-01-14T02:01:03.043Z","avatar_url":"https://github.com/VLprojects.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Convertible\n\n**Convertible** is a Kotlin Symbol Processor (KSP) library that automatically generates \ntype-safe converters for your custom types. It eliminates the need to manually write converters for \nframeworks and modules like JPA, Jackson, Spring Data MongoDB, and Spring MVC by generating \nthem at compile time.\n\nWhen you define value classes, data wrappers, or enums, you often need to integrate them with frameworks \nthat expect primitive types. Writing boilerplate `Converter`, `Serializer`, or `Mapper` classes for each of them\nis repetitive, error-prone, and clutters your codebase.\n\n**Convertible** solves this problem by using a single annotation and inferring everything needed \nto generate converters for the targets you use — while remaining fully type-safe, pluggable, and easy to extend.\n\n---\n\n## Features\n\n- Annotation-driven with smart defaults\n- Supports `data class`, `value class`, `enum class`, companion factories\n- Handles nullable fields correctly\n- Modular architecture — use only the targets (scopes) you need\n\n## Installation\n\nFor Gradle with Kotlin DSL:\n\n```kotlin\nplugins {\n\tid(\"com.google.devtools.ksp\") version \"2.1.21-2.0.1\"\n}\n\ndependencies { \n\timplementation(\"pro.vlprojects:convertible-core:0.1.0\")\n\timplementation(\"pro.vlprojects:convertible-jpa:0.1.0\") // or other scopes\n\tksp(\"pro.vlprojects:convertible-jpa:0.1.0\")\n}\n```\n\n## Usage\n\n1. Define your VO class\n```kotlin\n@Convertible(scopes = [Scope.JPA])\ndata class UserId(val raw: String)\n```\n\n2. Use in entity\n```kotlin\n@Entity\nclass User(\n\t@Id lateinit var id: UserId\n)\n```\n\n3. Auto-generated converter\n```kotlin\n@Component(value = \"jpa.UserIdConverter\")\n@Converter(autoApply = true)\nclass UserIdConverter : AttributeConverter\u003cUserId, String\u003e {\n\toverride fun convertToDatabaseColumn(attribute: UserId): String = attribute.raw\n\toverride fun convertToEntityAttribute(dbData: String): UserId = UserId(dbData)\n}\n```\n\n## Supported Targets (Scopes)\n| Scope     | Description                   | Module                            |\n|-----------|-------------------------------|-----------------------------------|\n| `JPA`     | JPA `AttributeConverter`      | `convertible-jpa`                 |\n| `JACKSON` | Jackson (de)serializer module | `convertible-jackson` *(planned)* |\n| `MONGODB` | MongoDB custom converters     | `convertible-mongo` *(planned)*   |\n| `MVC`     | Web argument/resolver support | `convertible-mvc` *(planned)*     |\n\n\n\n## ⚠️ Constraints\n\n- Classes must be `public` and not inner/nested.\n- `@Convertible` supports only types with exactly one extractable primitive value.\n- Companion factories must be annotated with `@ConvertibleFactory` and must be `public static` or in `companion object`.\n- Only one `@ConvertibleValue` or eligible getter per type is allowed.\n- No runtime reflection is used — converters are fully generated at compile-time.\n\n## License\n\nThis project is licensed under the MIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvlprojects%2Fconvertible","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvlprojects%2Fconvertible","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvlprojects%2Fconvertible/lists"}