← Runtime data validation

Data.NumberOptions

luastra/data

Data.NumberOptions 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.NumberOptions 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
integerboolean?Checked integer field of Data.NumberOptions; its exact admitted type is boolean?.
minnumber?Checked min field of Data.NumberOptions; its exact admitted type is number?.
maxnumber?Checked max field of Data.NumberOptions; its exact admitted type is number?.

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 NumberOptions = { integer: boolean?, min: number?, max: number? }

Complete inventory

View all pages in Runtime data validation
← Previous: Data.StringOptionsNext: Data.ArrayOptions →