Function pact_consumer::patterns::each_key

source ยท
pub fn each_key<P>(pattern: P) -> EachKey
where P: Into<StringPattern>,
Expand description

A pattern which applies another pattern to each key of an object, and which generates an example key. A regex matcher is the only matcher that makes sense to use on keys.

use pact_consumer::*;

// Each key must match the given regex, and an example key is supplied.
use pact_consumer::patterns::each_key;
each_key(matching_regex!("[a-z]{3}[0-9]", "key1"));