JsonTupleTemplate

io.github.cakelier.tuples.space.JsonTemplate$.JsonTupleTemplate
See theJsonTupleTemplate companion object
sealed trait JsonTupleTemplate extends JsonTemplate

A JsonTemplate that matches a JsonTuple.

This template matches a JsonTuple if and only if its inner JsonTemplates matches against the corresponding elements of the tuple. Being a tuple in fact a representation of a JSON Array, the JSON Schema specification allows matching JSON Arrays even if not all of its elements have a template to match against, but limits the matching abilities only to the first ones, the ones which corresponds to inner templates. This is reflected allowing "additional items" to be present, so allowing that this template can match even if the number of its inner JsonTemplates is not equal to the arity of the tuple, but it is inferior. A template with more inner templates than the tuple that is trying to match against will never match.

Attributes

Companion
object
Graph
Supertypes
trait JsonTemplate
class Object
trait Matchable
class Any

Members list

Value members

Inherited methods

def matches(value: JsonElement): Boolean

Returns whether or not the given JsonElement matches this template.

Returns whether or not the given JsonElement matches this template.

Value parameters

value

the JsonElement to match

Attributes

Returns

whether or not the given JsonElement matches

Inherited from:
JsonTemplate

Abstract fields

Whether or not the JsonTuple to be matched against is allowed to have more JsonElements than the JsonTemplates contained in this template.

Whether or not the JsonTuple to be matched against is allowed to have more JsonElements than the JsonTemplates contained in this template.

Attributes

The JsonTemplates to be used to match against the JsonElements of the JsonTuple in their corresponding positions.

The JsonTemplates to be used to match against the JsonElements of the JsonTuple in their corresponding positions.

Attributes