Skip to content

feat: stabilize code generator#12

Merged
kansson merged 1 commit intomainfrom
feat/stable-codegen
Jan 15, 2026
Merged

feat: stabilize code generator#12
kansson merged 1 commit intomainfrom
feat/stable-codegen

Conversation

@kansson
Copy link
Owner

@kansson kansson commented Jan 15, 2026

Type System:

  • Refactor ConvexFunction from data class to sealed interface
    hierarchy
  • Add HttpAction type (filtered from code generation)
  • Add Nullable value class for nullable union serialization

Union Support:

  • Literal unions (v.literal("a") | v.literal("b")) → Kotlin enums
    with @SerialName
  • Nullable literal unions → Nullable
  • Primitive unions (string | number) → sealed class with typed
    variants (StringValue, DoubleValue, etc.)
  • Object/discriminated unions → sealed class with auto-detected
    @JsonClassDiscriminator
  • T | null → Nullable wrapper

Object Handling:

  • Empty objects → data object (instead of data class)
  • Functions without args → data object
  • Field name sanitization with @SerialName for special characters
  • Class name sanitization (CamelCase conversion)

DSL Builders:

  • Proper handling of nested object builders
  • Optional field support with null defaults
  • Sealed class fields nullable in builder with !! assertion on
    build()
  • Nullable union fields unwrap to inner type in builder

@kansson kansson merged commit 3894e6a into main Jan 15, 2026
1 check passed
@kansson kansson deleted the feat/stable-codegen branch January 15, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant