Skip to content

Generate an optional validate()/isValid()/validity() triad on models #64

Description

@OmarAlJarrah

Problem

Union disambiguation and explicit validation need a way to score how well a payload matches a model — but it's expensive and must never run implicitly.

Proposed change

Generate a memoized, opt-in validate()/isValid()/validity() triad, never called on the deserialize path. Use validity-scoring only as the fallback union strategy (prefer a discriminator when present, to avoid N full deserializations).

Acceptance

  • Opt-in triad generated
  • Not invoked during deserialize

Depends on the four-state field model.

Dependencies


Priority: low · Effort: medium

Metadata

Metadata

Assignees

No one assigned

    Labels

    codegenfuture KotlinPoet codegenenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions