Current limitations
Currently, Lekko relies on a cross-language DSL with accurate mappings to each SDK language. For this reason, Lekko only supports validators in its intermediate DSL. For example:
def validate(url):
assert.contains(url, "https")
export(
Config(
description = "lekko backend url",
default = "http://backend.lekko.com", # Fails the https invariant
overrides = [
("id == 3", "https://wayne.lekko.com"),
],
validator = validate,
),
)
Supported assertions
assert.eq(x, y)
passes ifx == y
.assert.ne(x, y)
passes ifx != y
.assert.lt(x, y)
passes ifx < y
.assert.true(condition)
is a logical check of the Boolean expression specified incondition
.assert.contains(x, y)
passes ifx
exists iny
.assert.fail(message)
fails with the error message specified inmessage
.