Skip to content

Type Alias: FeatureInputValueDto

@kortexya/reasoninglayer


@kortexya/reasoninglayer / FeatureInputValueDto

FeatureInputValueDto = FeatureInputTermRef | FeatureInputSortRef | ValueDto | FeatureInputConstrainedVariable | FeatureInputVariable | FeatureInputInlineTerm | FeatureInputInlineTermByName | FeatureInputValueDto[] | string | number | boolean

Defined in: src/types/homoiconic.ts:190

Input value type for features in homoiconic inference requests.

A structural (untagged) union with 12 variants. The variant ordering matches the Rust #[serde(untagged)] deserialization order — this ordering is critical because Rust tries each variant in definition order.

Variants (in Rust deserialization order):

  1. TermRef — { term_id: string } — reference an existing term
  2. SortRef — { sort_ref: string } — a sort as a first-class value
  3. Typed — { type: "…", value: … } — a tagged ValueDto envelope
  4. ConstrainedVariable — { name: string, constraint: TermInputDto } — variable with constraint
  5. Variable — { name: string } — unconstrained variable (e.g., "?X")
  6. InlineTerm — { sort_id: string, features?: ..., binding?: string } — inline term by sort UUID
  7. InlineTermByName — { sort_name: string, features?: ..., binding?: string } — inline term by sort name
  8. List — FeatureInputValueDto[] — list of feature input values
  9. String — string — string primitive
  10. Integer — number (integer) — integer primitive
  11. Real — number (float) — real primitive
  12. Boolean — boolean — boolean primitive

Serialization format: Untagged (structural discrimination) — with one deliberate exception. The Typed variant is the tagged ValueDto envelope term CRUD takes, sent as-is: {"type":"DateTime","value":"…"}. It is the only spelling for the scalars with no JSON literal of their own (DateTime, BigInteger, SortId, Measurement, Geometry, fuzzy values, ExternalRef, a Reference by designator). Prefer the untagged variants for everything else — a plain string, number or boolean, or { termId } for a reference by id.

Critical ordering constraint: ConstrainedVariable MUST come before Variable — both have name, but the constrained version also has constraint. Rust’s serde(untagged) tries them in definition order.

An object that matches no variant is refused before the request is sent, with a ValidationError whose field names the feature.

Do NOT use with term CRUD endpoints — use import(‘./values.js’).ValueDto instead.