Package-level declarations

Home of the core KForm concepts.

Home of the core KForm concepts.

Types

Link copied to clipboard
@Serializable(with = AbsolutePath.Serializer::class)
class AbsolutePath : Path

Representation of an absolute path as a subtype of Path and as a list of absolute path fragments. Absolute paths are always "resolved" (i.e. they contain no unnecessary fragments such as current path fragments or consecutive recursive wildcard fragments).

Link copied to clipboard

Fragment of an absolute path.

Link copied to clipboard
class AsyncFormValidator<T> @JvmOverloads constructor(formSchema: Schema<T>, externalValidations: ExternalValidations = emptyMap(), coroutineScope: CoroutineScope = GlobalScope)

This class is a simple FormValidator wrapper for usage from Java, providing methods returning completable futures instead of using suspend functions or Kotlin flows.

Link copied to clipboard
abstract class AsyncValidation<in T> : JvmValidation<T>

Asynchronous validation more easily implementable from Java.

Link copied to clipboard
open class AtPathException @JvmOverloads constructor(val path: AbsolutePath, message: String, cause: Throwable? = null) : RuntimeException

Exception occurring at the provided path with the given message and optional cause.

Link copied to clipboard

Status of the automatic validations.

Link copied to clipboard

Schema representing metadata on collections of type T with children of type TChildren.

Link copied to clipboard

State for collections (i.e. values represented by collection schemas).

Link copied to clipboard
interface Computation

Form manager computation.

Link copied to clipboard
abstract class ComputationContext(schema: Schema<*>, val path: AbsolutePath, val schemaPath: AbsolutePath, val dependenciesInfo: DependenciesValueInfo, val externalContexts: ExternalContexts)

Context provided to a form manager computation when running it, contains the values of the computation's dependencies at the time the computation was executed.

Link copied to clipboard
abstract class ComputedValue<out T> : Computation

Computed value for values of type T.

Link copied to clipboard
open class ComputedValueContext(schema: Schema<*>, val path: AbsolutePath, val schemaPath: AbsolutePath, val dependenciesInfo: DependenciesValueInfo, val externalContexts: ExternalContexts) : ComputationContext

Context provided to a computed value when running it, contains the values of the computed value's dependencies at the time the computed value was executed.

Link copied to clipboard

Status of the computed values.

Link copied to clipboard

Value information of a validation's dependencies.

Link copied to clipboard
data class DependencyInfo(val path: Path, val type: KType)

Information about a validation dependency, includes its path and type.

Link copied to clipboard

Exception thrown when attempting to access a dependency with key dependencyKey that could not be found during the execution of a computation.

Link copied to clipboard

Display status of a value.

Link copied to clipboard
typealias EventHandler = suspend (event: FormManagerEvent<*>) -> Unit

Function used to subscribe to form manager events.

Link copied to clipboard
typealias ExternalContextHandler<T, TResult> = suspend (externalContext: T) -> TResult

Function used to handle the gotten external context.

Link copied to clipboard
class ExternalContextNotFoundException(val externalContextName: String) : RuntimeException

Exception thrown when attempting to access an external context with name externalContextName that could not be found during the execution of a computation.

Link copied to clipboard

External contexts.

Link copied to clipboard

External validations.

Link copied to clipboard
class FormManager @JvmOverloads constructor(formSchema: Schema<*>, initialValue: Any?, externalContexts: ExternalContexts? = null, validationMode: ValidationMode = ValidationMode.Auto, coroutineContext: CoroutineContext = Dispatchers.Default, autoInit: Boolean = true)

Class responsible for managing the data and state of a form.

Link copied to clipboard
sealed interface FormManagerEvent<T>

Event emitted by the form manager. Events can be of one of two "main" types: ValueEvent (signaling a change in a value of the form) or StateEvent (signaling a change in the form's state).

Link copied to clipboard
class FormValidator<T>(formSchema: Schema<T>, externalValidations: ExternalValidations = emptyMap())

Class used to validate form values. Form values are of type T and represent the content of a form with the provided form schema.

Link copied to clipboard
data class Info<T>(val value: T, val schema: Schema<T>, val path: AbsolutePath, val schemaPath: AbsolutePath, val dirty: Boolean, val touched: Boolean, val issues: List<ValidationIssue>, val validationStatus: ValidationStatus, val displayStatus: DisplayStatus)

Information about a value in the form manager.

Link copied to clipboard
typealias InfoHandler<TResult> = suspend (infoFlow: Flow<Info<*>>) -> TResult

Function used to handle the flow of information related to some path.

Link copied to clipboard
class InvalidDependencyPathException(val path: AbsolutePath, val computation: Computation, val dependencyKey: String, val dependencyPath: Path) : InvalidPathException

Exception thrown when a computation at path path has a dependency with an invalid path.

Link copied to clipboard
class InvalidDependencyTypeException(val path: AbsolutePath, val computation: Computation, val expectedType: String, val dependencyKey: String, val dependencyType: KType) : InvalidPathException

Exception thrown when a computation at path path has a dependency with an invalid type.

Link copied to clipboard
open class InvalidPathException(val path: AbsolutePath, message: String) : AtPathException

Exception with message message thrown when an invalid path was provided.

Link copied to clipboard
class InvalidPathToObserveException(val path: AbsolutePath, val computation: StatefulComputation<*, *>, val toObserve: Path) : InvalidPathException

Exception thrown when a stateful computation at path path has an invalid path to observe toObserve.

Link copied to clipboard
typealias IssuesHandler<TResult> = suspend (issuesFlow: Flow<LocatedValidationIssue>) -> TResult

Function used to handle the flow of located validation issues.

Link copied to clipboard
abstract class JvmValidation<in T> : Validation<T>

Validation more easily implementable from Java.

Link copied to clipboard
@Serializable
@SerialName(value = "error")
class LocatedValidationError @JvmOverloads constructor(val path: AbsolutePath, val code: String, val dependencies: Set<AbsolutePath> = emptySet(), val dependsOnDescendants: Boolean = false, val externalContextDependencies: Set<String> = emptySet(), val data: ValidationIssueData = emptyMap()) : LocatedValidationIssue

Validation error emitted by a form validator or manager containing location information.

Link copied to clipboard
@Serializable
@SerialName(value = "failure")
class LocatedValidationFailure : LocatedValidationIssue

Validation error emitted by a manager containing location information when a validation fails to run (throws an exception while being executed). The code of this validation error is ValidationFailure.CODE.

Link copied to clipboard
@Serializable
sealed class LocatedValidationIssue

Validation issue emitted by a form validator or manager containing location information.

Link copied to clipboard
@Serializable
@SerialName(value = "warning")
class LocatedValidationWarning @JvmOverloads constructor(val path: AbsolutePath, val code: String, val dependencies: Set<AbsolutePath> = emptySet(), val dependsOnDescendants: Boolean = false, val externalContextDependencies: Set<String> = emptySet(), val data: ValidationIssueData = emptyMap()) : LocatedValidationIssue

Validation warning emitted by a form validator or manager containing location information.

Link copied to clipboard
open class Observer<T, TState>(val toObserve: Path, val updateState: UpdateStateFn<T, TState>)

Observer used within a stateful computation.

Link copied to clipboard
typealias OnSubscription = suspend () -> Unit

Function to run during a form manager subscription.

Link copied to clipboard
interface ParentSchema<T> : Schema<T>

Schema representing metadata on parent values of type T.

Link copied to clipboard
interface ParentState : State

State for parent values (i.e. values represented by parent schemas).

Link copied to clipboard
@Serializable(with = Path.Serializer::class)
open class Path(fragments: List<PathFragment> = emptyList())

Representation of a path as a list of path fragments.

Link copied to clipboard
sealed class PathFragment

Fragment of a path.

Link copied to clipboard
typealias PathOrString = Any

Typealias used to represent a type where either a Path or a String (representing a path) are accepted.

Link copied to clipboard
interface Schema<T>

Schema representing metadata on values of type T.

Link copied to clipboard
interface SchemaEventsBus

Bus used by schemas to emit events representing "what happened" to values.

Link copied to clipboard
data class SchemaInfo<T>(val schema: Schema<T>, val path: AbsolutePath, val queriedPath: AbsolutePath = path)

Information about a schema of values of type T: the schema instance, and its path.

Link copied to clipboard
interface State

State associated with each value in the form manager.

Link copied to clipboard
sealed class StateEvent<T> : FormManagerEvent<T>

Event emitted by the form manager signaling a change in the form's state.

Link copied to clipboard

Computation of values where the form manager maintains a state of type TState for each managed computation.

Link copied to clipboard

Computed value for values of type T where the form manager maintains a computed value state of type TState for each managed value.

Link copied to clipboard

Validation for values of type T where the form manager maintains a validation state of type TState for each managed value.

Link copied to clipboard
data class StateInfo<T>(val state: State?, val schema: Schema<T>, val path: AbsolutePath)

Information about the state of a value.

Link copied to clipboard
abstract class SyncValidation<in T> : JvmValidation<T>

Synchronous validation more easily implementable from Java.

Link copied to clipboard
data class TypeInfo(val name: String, val nullable: Boolean = false, val arguments: List<TypeInfo> = emptyList(), val restrictions: Map<String, Any?> = emptyMap())

Type of value represented by a schema.

Link copied to clipboard
typealias Unsubscribe = suspend () -> Unit

Function used to unsubscribe from a form manager subscription.

Link copied to clipboard
typealias UpdateStateFn<T, TState> = suspend (state: TState, event: ValueEvent<T>) -> TState

Function used to update the state of a stateful computation.

Link copied to clipboard

Criteria that determines whether to run schema-internal validations and/or external validations when calling FormValidator.validate.

Link copied to clipboard
abstract class Validation<in T> : Computation

Validation for values of type T.

Link copied to clipboard
open class ValidationContext(value: Any?, schema: Schema<*>, val path: AbsolutePath, val schemaPath: AbsolutePath, val dependenciesInfo: DependenciesValueInfo, val externalContexts: ExternalContexts) : ComputationContext

Context provided to a validation when running it, contains the values of the validation's dependencies at the time the validation was executed.

Link copied to clipboard
@Serializable
@SerialName(value = "error")
class ValidationError @JvmOverloads constructor(val code: String, val data: ValidationIssueData = emptyMap()) : ValidationIssue

Validation error emitted by a validation indicating a problem with the form data.

Link copied to clipboard
@Serializable
@SerialName(value = "failure")
class ValidationFailure : ValidationIssue

Validation issue built by the manager when a validation fails to run (throws an exception while being executed). The code of this validation error is CODE.

Link copied to clipboard
class ValidationFailureException(val path: AbsolutePath, val validation: Validation<*>, cause: Throwable) : AtPathException

Exception thrown when a validation fails to run via the form validator or form utilities due to an exception being thrown while running it.

Link copied to clipboard
@Serializable
sealed class ValidationIssue

Validation issue emitted by a validation indicating a (potential) problem with the form data.

Link copied to clipboard

Data associated with a validation issue. Useful, for example, for displaying (possibly located) messages associated with the issue.

Link copied to clipboard

Severity of a validation issue.

Link copied to clipboard

Form manager validation mode.

Link copied to clipboard

Validation status of a value.

Link copied to clipboard
@Serializable
@SerialName(value = "warning")
class ValidationWarning @JvmOverloads constructor(val code: String, val data: ValidationIssueData = emptyMap()) : ValidationIssue

Validation warning emitted by a validation indicating a potential problem with the form data.

Link copied to clipboard
sealed class ValueEvent<T> : FormManagerEvent<T>

Event emitted by the form manager signaling a change in a value of type T of the form.

Link copied to clipboard
typealias ValueHandler<T, TResult> = suspend (value: T) -> TResult

Function used to handle a gotten value.

Link copied to clipboard
data class ValueInfo<T>(val value: T, val schema: Schema<T>, val path: AbsolutePath, val schemaPath: AbsolutePath)

Information about a value of type T: the value itself, its absolute path, and its schema.

Link copied to clipboard
typealias ValueInfoHandler<TResult> = suspend (infoFlow: Flow<ValueInfo<*>>) -> TResult

Function used to handle the flow of value information related to some path.

Functions

Link copied to clipboard

Returns whether a collection of located validation issues contains any errors.

Returns whether a flow of located validation issues contains any errors.

Link copied to clipboard

Returns whether a collection of located validation issues contains any issues at all.

Returns whether a flow of located validation issues contains any issues at all.

Link copied to clipboard

Returns whether a collection of located validation issues contains no errors.

Returns whether a flow of located validation issues contains no errors.

Link copied to clipboard

Returns whether a collection of located validation issues contains no issues at all.

Returns whether a flow of located validation issues contains no issues at all.

Link copied to clipboard

Returns whether a collection of located validation issues contains no warnings.

Returns whether a flow of located validation issues contains no warnings.

Link copied to clipboard

Returns whether a collection of located validation issues contains any warnings.

Returns whether a flow of located validation issues contains any warnings.

Link copied to clipboard
suspend fun <T> get(formSchema: Schema<T>, formValue: T, path: String): Any?
suspend fun <T> get(formSchema: Schema<T>, formValue: T, path: Path): Any?

Returns the single part of the form value formValue (with schema formSchema) matching path.

Link copied to clipboard
@JvmName(name = "get")
fun <T> getAsync(formSchema: Schema<T>, formValue: T, path: String, coroutineScope: CoroutineScope = GlobalScope): CompletableFuture<Any?>
@JvmName(name = "get")
fun <T> getAsync(formSchema: Schema<T>, formValue: T, path: Path, coroutineScope: CoroutineScope = GlobalScope): CompletableFuture<Any?>

Returns a future that completes with the single part of the form value formValue (with schema formSchema) matching path.

Link copied to clipboard
suspend fun <T> getClone(formSchema: Schema<T>, formValue: T, path: String): Any?
suspend fun <T> getClone(formSchema: Schema<T>, formValue: T, path: Path): Any?

Returns a clone (deep copy) of the single part of the form value formValue (with schema formSchema) matching path.

Link copied to clipboard
@JvmName(name = "getClone")
fun <T> getCloneAsync(formSchema: Schema<T>, formValue: T, path: String, coroutineScope: CoroutineScope = GlobalScope): CompletableFuture<Any?>
@JvmName(name = "getClone")
fun <T> getCloneAsync(formSchema: Schema<T>, formValue: T, path: Path = AbsolutePath.ROOT, coroutineScope: CoroutineScope = GlobalScope): CompletableFuture<Any?>

Returns a future that completes with a clone (deep copy) of the single part of the form value formValue (with schema formSchema) matching path.

Link copied to clipboard
suspend fun <T> has(formSchema: Schema<T>, formValue: T, path: String): Boolean
suspend fun <T> has(formSchema: Schema<T>, formValue: T, path: Path): Boolean

Returns whether there exists a part of the form value formValue (with schema formSchema) matching path.

Link copied to clipboard
@JvmName(name = "has")
fun <T> hasAsync(formSchema: Schema<T>, formValue: T, path: String, coroutineScope: CoroutineScope = GlobalScope): CompletableFuture<Boolean>
@JvmName(name = "has")
fun <T> hasAsync(formSchema: Schema<T>, formValue: T, path: Path, coroutineScope: CoroutineScope = GlobalScope): CompletableFuture<Boolean>

Returns a future that completes with whether there exists a part of the form value formValue (with schema formSchema) matching path.

Link copied to clipboard
suspend fun <T> isValid(formSchema: Schema<T>, formValue: T, externalContexts: ExternalContexts? = null): Boolean

Returns whether all parts of the form value formValue (with schema formSchema) are valid according to their schemas. These parts are said to be valid if they contain no validation errors.

suspend fun <T> isValid(formSchema: Schema<T>, formValue: T, path: String, externalContexts: ExternalContexts? = null): Boolean
suspend fun <T> isValid(formSchema: Schema<T>, formValue: T, path: Path, externalContexts: ExternalContexts? = null): Boolean

Returns whether the parts of the form value formValue (with schema formSchema) matching path are valid according to their schemas. These parts are said to be valid if they contain no validation errors.

Link copied to clipboard
@JvmName(name = "isValid")
fun <T> isValidAsync(formSchema: Schema<T>, formValue: T, externalContexts: ExternalContexts? = null, coroutineScope: CoroutineScope = GlobalScope): CompletableFuture<Boolean>

Returns a future that completes with whether all parts of the form value formValue (with schema formSchema) are valid according to the validator's schema.

@JvmName(name = "isValid")
fun <T> isValidAsync(formSchema: Schema<T>, formValue: T, path: String, externalContexts: ExternalContexts? = null, coroutineScope: CoroutineScope = GlobalScope): CompletableFuture<Boolean>
@JvmName(name = "isValid")
fun <T> isValidAsync(formSchema: Schema<T>, formValue: T, path: Path, externalContexts: ExternalContexts? = null, coroutineScope: CoroutineScope = GlobalScope): CompletableFuture<Boolean>

Returns a future that completes with whether the parts of the form value formValue (with schema formSchema) matching path are valid according to the validator's schema.

Link copied to clipboard
suspend fun <T> isValidExternally(formSchema: Schema<T>, formValue: T, externalValidations: ExternalValidations, externalContexts: ExternalContexts? = null): Boolean

Returns whether all parts of the form value formValue (with schema formSchema) are valid according to the provided external validations. These parts are said to be valid if they contain no validation errors.

suspend fun <T> isValidExternally(formSchema: Schema<T>, formValue: T, path: String, externalValidations: ExternalValidations, externalContexts: ExternalContexts? = null): Boolean
suspend fun <T> isValidExternally(formSchema: Schema<T>, formValue: T, path: Path, externalValidations: ExternalValidations, externalContexts: ExternalContexts? = null): Boolean

Returns whether the parts of the form value formValue (with schema formSchema) matching path are valid according to the provided external validations. These parts are said to be valid if they contain no validation errors.

Link copied to clipboard
@JvmName(name = "isValidExternally")
fun <T> isValidExternallyAsync(formSchema: Schema<T>, formValue: T, externalValidations: ExternalValidations, externalContexts: ExternalContexts? = null, coroutineScope: CoroutineScope = GlobalScope): CompletableFuture<Boolean>

Returns a future that completes with whether all parts of the form value formValue (with schema formSchema) are valid according to the provided external validations.

@JvmName(name = "isValidExternally")
fun <T> isValidExternallyAsync(formSchema: Schema<T>, formValue: T, path: String, externalValidations: ExternalValidations, externalContexts: ExternalContexts? = null, coroutineScope: CoroutineScope = GlobalScope): CompletableFuture<Boolean>
@JvmName(name = "isValidExternally")
fun <T> isValidExternallyAsync(formSchema: Schema<T>, formValue: T, path: Path, externalValidations: ExternalValidations, externalContexts: ExternalContexts? = null, coroutineScope: CoroutineScope = GlobalScope): CompletableFuture<Boolean>

Returns a future that completes with whether the parts of the form value formValue (with schema formSchema) matching path are valid according to the provided external validations.

Link copied to clipboard
fun isValidPath(formSchema: Schema<*>, path: String): Boolean
fun isValidPath(formSchema: Schema<*>, path: Path): Boolean

Returns whether there exists at least one schema within formSchema matching path.

Link copied to clipboard
suspend fun <T> remove(formSchema: Schema<T>, formValue: T, path: String)
suspend fun <T> remove(formSchema: Schema<T>, formValue: T, path: Path)

Removes the values matching path that are part of the form value formValue (with schema formSchema) from their parent collection(s).

Link copied to clipboard
@JvmName(name = "remove")
fun <T> removeAsync(formSchema: Schema<T>, formValue: T, path: String, coroutineScope: CoroutineScope = GlobalScope): CompletableFuture<Unit>
@JvmName(name = "remove")
fun <T> removeAsync(formSchema: Schema<T>, formValue: T, path: Path, coroutineScope: CoroutineScope = GlobalScope): CompletableFuture<Unit>

Returns a future that completes once the values matching path that are part of the form value formValue (with schema formSchema) have been removed from their parent collection(s).

Link copied to clipboard
suspend fun <T> reset(formSchema: Schema<T>, formValue: T, path: String)
suspend fun <T> reset(formSchema: Schema<T>, formValue: T, path: Path)

Resets the values at path that are part of the form value formValue (with schema formSchema) to their initial value.

Link copied to clipboard
@JvmName(name = "reset")
fun <T> resetAsync(formSchema: Schema<T>, formValue: T, path: String, coroutineScope: CoroutineScope = GlobalScope): CompletableFuture<Unit>
@JvmName(name = "reset")
fun <T> resetAsync(formSchema: Schema<T>, formValue: T, path: Path, coroutineScope: CoroutineScope = GlobalScope): CompletableFuture<Unit>

Returns a future that completes once the values at path that are part of the form value formValue (with schema formSchema) have been reset to their initial value.

Link copied to clipboard
fun schema(formSchema: Schema<*>, path: String): Schema<*>
fun schema(formSchema: Schema<*>, path: Path): Schema<*>

Returns the single schema within formSchema matching path.

Link copied to clipboard
fun schemaInfo(formSchema: Schema<*>, path: String): Sequence<SchemaInfo<*>>
fun schemaInfo(formSchema: Schema<*>, path: Path = AbsolutePath.MATCH_ALL): Sequence<SchemaInfo<*>>

Returns a sequence of information about the schemas within formSchema matching path.

Link copied to clipboard
suspend fun <T> set(formSchema: Schema<T>, formValue: T, path: String, toSet: Any?)
suspend fun <T> set(formSchema: Schema<T>, formValue: T, path: Path, toSet: Any?)

Sets values at path that are part of the form value formValue (with schema formSchema) with value toSet.

Link copied to clipboard
@JvmName(name = "set")
fun <T> setAsync(formSchema: Schema<T>, formValue: T, path: String, toSet: Any?, coroutineScope: CoroutineScope = GlobalScope): CompletableFuture<Unit>
@JvmName(name = "set")
fun <T> setAsync(formSchema: Schema<T>, formValue: T, path: Path, toSet: Any?, coroutineScope: CoroutineScope = GlobalScope): CompletableFuture<Unit>

Returns a future that completes once the values at path that are part of the form value formValue (with schema formSchema) have been set with value toSet.

Link copied to clipboard

Converts the receiver Path or String into an absolute path, if it wasn't one already.

Converts the receiver path into an absolute path, if it wasn't one already.

Link copied to clipboard

Converts the receiver Path or String into a path, if it wasn't one already.

Link copied to clipboard
fun <T> validate(formSchema: Schema<T>, formValue: T, externalContexts: ExternalContexts? = null): Flow<LocatedValidationIssue>

Validates all parts of the form value formValue against formSchema. Returns a flow of found validation issues.

fun <T> validate(formSchema: Schema<T>, formValue: T, path: String, externalContexts: ExternalContexts? = null): Flow<LocatedValidationIssue>
fun <T> validate(formSchema: Schema<T>, formValue: T, path: Path, externalContexts: ExternalContexts? = null): Flow<LocatedValidationIssue>

Validates the parts of the form value formValue matching path against formSchema. Returns a flow of found validation issues.

Link copied to clipboard
@JvmName(name = "validate")
fun <T> validateAsync(formSchema: Schema<T>, formValue: T, externalContexts: ExternalContexts? = null, coroutineScope: CoroutineScope = GlobalScope): CompletableFuture<List<LocatedValidationIssue>>

Validates all parts of the form value formValue against formSchema. Returns a future that completes with a list of found validation issues.

@JvmName(name = "validate")
fun <T> validateAsync(formSchema: Schema<T>, formValue: T, path: String, externalContexts: ExternalContexts? = null, coroutineScope: CoroutineScope = GlobalScope): CompletableFuture<List<LocatedValidationIssue>>
@JvmName(name = "validate")
fun <T> validateAsync(formSchema: Schema<T>, formValue: T, path: Path, externalContexts: ExternalContexts? = null, coroutineScope: CoroutineScope = GlobalScope): CompletableFuture<List<LocatedValidationIssue>>

Validates the parts of the form value formValue matching path against formSchema. Returns a future that completes with a list of found validation issues.

Link copied to clipboard
fun <T> validateExternally(formSchema: Schema<T>, formValue: T, externalValidations: ExternalValidations, externalContexts: ExternalContexts? = null): Flow<LocatedValidationIssue>

Validates all parts of the form value formValue with schema formSchema against a map of external validations externalValidations.

fun <T> validateExternally(formSchema: Schema<T>, formValue: T, path: String, externalValidations: ExternalValidations, externalContexts: ExternalContexts? = null): Flow<LocatedValidationIssue>
fun <T> validateExternally(formSchema: Schema<T>, formValue: T, path: Path, externalValidations: ExternalValidations, externalContexts: ExternalContexts? = null): Flow<LocatedValidationIssue>

Validates the parts of the form value formValue matching path with schema formSchema against a map of external validations externalValidations.

Link copied to clipboard
@JvmName(name = "validateExternally")
fun <T> validateExternallyAsync(formSchema: Schema<T>, formValue: T, externalValidations: ExternalValidations, externalContexts: ExternalContexts? = null, coroutineScope: CoroutineScope = GlobalScope): CompletableFuture<List<LocatedValidationIssue>>

Validates all parts of the form value formValue with schema formSchema against a map of external validations externalValidations. Returns a future that completes with a list of found validation issues.

@JvmName(name = "validateExternally")
fun <T> validateExternallyAsync(formSchema: Schema<T>, formValue: T, path: String, externalValidations: ExternalValidations, externalContexts: ExternalContexts? = null, coroutineScope: CoroutineScope = GlobalScope): CompletableFuture<List<LocatedValidationIssue>>
@JvmName(name = "validateExternally")
fun <T> validateExternallyAsync(formSchema: Schema<T>, formValue: T, path: Path, externalValidations: ExternalValidations, externalContexts: ExternalContexts? = null, coroutineScope: CoroutineScope = GlobalScope): CompletableFuture<List<LocatedValidationIssue>>

Validates the parts of the form value formValue matching path with schema formSchema against a map of external validations externalValidations. Returns a future that completes with a list of found validation issues.

Link copied to clipboard
fun validateExternalValidations(formSchema: Schema<*>, externalValidations: Map<PathOrString, Iterable<Validation<*>>>)

Validates the provided external validations in the context of the given formSchema by checking that all validation dependencies are valid (i.e. that they point to valid locations and have valid types).

Link copied to clipboard
fun validatePath(formSchema: Schema<*>, path: Path)

Validates that the provided path points to a schema of formSchema.

Link copied to clipboard
fun validateSchemaValidations(formSchema: Schema<*>)

Validates all validations of the provided formSchema by checking that all validation dependencies are valid (i.e. that they point to valid locations and have valid types).

Link copied to clipboard
fun <T> valueInfo(formSchema: Schema<T>, formValue: T, path: String): Flow<ValueInfo<*>>
fun <T> valueInfo(formSchema: Schema<T>, formValue: T, path: Path = AbsolutePath.MATCH_ALL): Flow<ValueInfo<*>>

Returns a flow of information about the parts of the form value formValue (with schema formSchema) matching path.

Link copied to clipboard
@JvmName(name = "valueInfo")
fun <T> valueInfoAsync(formSchema: Schema<T>, formValue: T, path: String, coroutineScope: CoroutineScope = GlobalScope): CompletableFuture<List<ValueInfo<*>>>
@JvmName(name = "valueInfo")
fun <T> valueInfoAsync(formSchema: Schema<T>, formValue: T, path: Path = AbsolutePath.MATCH_ALL, coroutineScope: CoroutineScope = GlobalScope): CompletableFuture<List<ValueInfo<*>>>

Returns a future that completes with a list of information about the parts of the form value formValue (with schema formSchema) matching path.