All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.schemas.AbstractCollectionSchema.kt Maven / Gradle / Ivy

There is a newer version: 0.23.0
Show newest version
package io.kform.schemas

import io.kform.*

/**
 * Abstract schema representing collections of type [T] with elements of type [TChildren] whose
 * schema is of type [TSchema].
 *
 * @property elementsSchema Schema of the collection's elements.
 */
public abstract class AbstractCollectionSchema>(
    public val elementsSchema: TSchema
) : CollectionSchema {
    override fun childrenSchemas(
        path: AbsolutePath,
        queriedPath: AbsolutePath,
        fragment: AbsolutePathFragment
    ): Sequence> = sequence {
        yield(
            SchemaInfo(
                elementsSchema,
                path.append(AbsolutePathFragment.Wildcard),
                queriedPath.append(fragment),
            )
        )
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy