Skip to content

JasperFx 1.25

Released April 2026.

Highlights

Extends the OptionsDescription rendering system so that downstream Critter Stack projects can describe complex properties (policies, rule sets, subscriptions) as a human-readable StringArray rather than falling back to a raw ToString() or being skipped entirely.

New in JasperFx.Descriptors

IOptionsValueAsStringArray — opt-in string array rendering

A complex type that implements this interface controls how it appears in an OptionsValue. The returned strings are joined for display and retained as the raw value so consumers can render each entry individually.

csharp
public interface IOptionsValueAsStringArray
{
    IReadOnlyList<string> ToOptionsValueStrings();
}

OptionsValue.WriteValue now checks for this interface after the built-in Uri/TimeSpan/Type/Assembly branches and before the generic ToString() fallback. The resulting OptionsValue has Type = PropertyType.StringArray and a RawValue of string[].

Use this when your type is essentially a collection of human-readable items (failure rules, subscription lists, filter chains) and you want each entry to be individually inspectable without polluting the type with extra child descriptions.

[DescribeAsStringArray] — attribute-driven string array rendering

For cases where you don't own the type (or the enumerable itself doesn't warrant its own dedicated interface), apply [DescribeAsStringArray] to any enumerable property. OptionsDescription.readProperties will call ToString() on each element and produce a single OptionsValue of type StringArray.

csharp
[DescribeAsStringArray]
public IReadOnlyList<Subscription> TopicSubscriptions => _subscriptions;

Without this attribute, non-string enumerable properties are skipped by the reflection walker.

Behavior changes

None. Both additions are purely additive:

  • Types without IOptionsValueAsStringArray continue through the existing ToString() fallback in OptionsValue.WriteValue.
  • Properties without [DescribeAsStringArray] continue to be skipped when their type is a non-string enumerable.

Released under the MIT License.