Use this rule to control that the YAML documents do not contain a key. Key names can be defined as a regular expression. The location of the key can be defined with two ancestor regular expressions.

Parameters

key-name
Regular expression that matches forbidden key names
included-ancestors
Regular expression that matches against an ancestor string made of joining the parent chain of the matching key. The parents are separated by a colon (:) and always start with an implicit <root> parent. So, the ancestor string for a connectionTimeout key could be: <root>:spring:datasource:hikari. If the includedAncestors regex matches the ancestor string of the key, the key is checked. The start and end line markers ^ and $ are implicit, just like the key regex. Leave empty for no included ancestor matching.
excluded-ancestors
Regular expression that matches against the ancestor string of the matching key, just like above. However, if this regex matches, the key is *not* checked. The start and end line markers ^ and $ are implicit, just like the key regex. Leave empty for no excluded ancestor matching.

Examples

With key-name = [tT]e.*t the following code snippet would PASS:

    Test1: value
    tesT: {key1: 4, key2: 8}

the following code snippets would FAIL:

    test: value
    tesT: {Test: 4, key2: 8}

With key-name = waitInterval.*|wait-interval.* and includedAncestors = .*:circuitbreaker the following code snippet would PASS:

uisa:
  circuitbreaker:
    failure-rate-threshold-percentage: 70
    wait-duration-in-open-state-millis: 1500

the following code snippets would FAIL:

uisa:
  circuitbreaker:
    failure-rate-threshold-percentage: 70
    wait-interval: 1500