Skip to content

docs: SPEC.md normative Host interface names variant properties ascii/raw/encoded, but the shipped API names all three value #116

Description

@OmarAlJarrah

Problem

SPEC.md's [MODEL-14] (lines 480-489) declares the Host sealed interface's variants as RegName(val ascii: String), IpFuture(val raw: String), and Opaque(val encoded: String), and [MODEL-16]/[MODEL-21] use MUST-level language referring to RegName.ascii/Opaque.encoded specifically by those names.

The shipped implementation (kuri/src/commonMain/kotlin/org/dexpace/kuri/host/Host.kt:60,131,148) names the property value on all three types — confirmed via the committed klib API dump, which shows only a value/getValue() accessor on each. Host.Ipv4.value, Ipv6.pieces/zoneId, and Host.Empty all match the spec correctly; only these three property names drift.

Reproduction

A consumer following the published interface writes:

val ascii = regName.ascii     // does not compile — no such property
val encoded = opaque.encoded  // does not compile — no such property
val raw = ipFuture.raw        // does not compile — no such property

All three fail to compile; the actual property in every case is .value.

Impact

The published spec misdescribes the shipped public Host API for three of its five variants, which is exactly the kind of detail an external implementer or advanced consumer would copy verbatim.

Suggested fix

Update [MODEL-14]/[MODEL-16]/[MODEL-21] to use value for all three variants, matching the shipped code, or rename the shipped properties to match the spec (a binary-incompatible API change, so the doc fix is much cheaper).

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions