Skip to main content

Transformation functions

constant

Commentary

added in 0.1.22

Generates the value of x always. This is useful if you want to generate a known value but also want to use parameters like null and elide to vary its nullity and absence.


Examples

Generating the value

{
"_gen": "constant",
"x": "foo"
}
[
"foo",
"foo",
"foo",
"foo",
"foo"
]

Specification

JSON schema

{
"type": "object",
"properties": {
"x": {}
},
"required": [
"x"
]
}