← Runtime data validation

Data.StringOptions

luastra/data

Data.StringOptions is the checked configuration record accepted by the related SDK operation. Required fields establish the minimum contract, while optional fields preserve documented defaults when omitted.

Before you use it

Add luastra/data to this module's dependencies in luastra.json, then import it with require("luastra/data"). No host capability is required. Define schemas outside render when they are reused.

How it fits

The exported type describes schemas or the tagged success/failure result returned by Data.decode.

When to use it

Use Data.StringOptions when a reusable variable or helper passes configuration to the related SDK operation. The exported type keeps optional and required fields aligned with the checked public contract.

Fields or definition

ParameterType / valuesDescription
minBytesnumber?Checked minBytes field of Data.StringOptions; its exact admitted type is number?.
maxBytesnumber?Checked maxBytes field of Data.StringOptions; its exact admitted type is number?.
trimboolean?Checked trim field of Data.StringOptions; its exact admitted type is boolean?.

What happens next

A checked schema/result annotation.

Failures and fixes

Ordinary invalid input is a Data.decode failure, not an exception. Invalid schema options are programmer errors and fail immediately. String bounds count UTF-8 bytes; Data.string has no pattern option in this alpha.

Availability

Public-source alpha API in 0.5.0-alpha; host-independent and synchronous.

Exact declaration

export type StringOptions = { minBytes: number?, maxBytes: number?, trim: boolean? }

Continue learning

Next steps

Data.string

Complete inventory

View all pages in Runtime data validation
← Previous: Data.ResultNext: Data.NumberOptions →