Skip to content

Commit dd504e8

Browse files
authored
Add in more custom schema information to the docs (#4141)
1 parent a23bb00 commit dd504e8

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

docs/cfn-schema-specification.md

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ _enum_ is used to restrict a value to a fixed set of values. [JSON Schema docs](
5252

5353
_pattern_ keyword is used to validate a string against a regular expression. [JSON Schema docs](https://json-schema.org/understanding-json-schema/reference/string#regexp)
5454

55+
##### enumCaseInsensitive
56+
57+
_enumCaseInsensitive_ is similar to _enum_ but performs case-insensitive matching for string values. This is useful for validating against values where case doesn't matter, such as certain AWS service names or property values.
58+
5559
#### length
5660

5761
_minLength_ and _maxLength_ are used to are used to constrain the size of a string. [JSON Schema docs](https://json-schema.org/understanding-json-schema/reference/string#length)
@@ -73,6 +77,18 @@ _minItems_ and _maxItems_ is used to provide the inclusive length of an array.
7377

7478
_prefixItems_ is similar to the definition of [prefixItems](https://json-schema.org/understanding-json-schema/reference/array#tupleValidation) but doesn't actually do the prefix. The current resource schema doesn't support [items](https://json-schema.org/understanding-json-schema/reference/array#items) being an array. We use `prefixItems` to validate array items where ordering matters.
7579

80+
##### uniqueKeys
81+
82+
_uniqueKeys_ validates that array items have unique values for specified keys. This is useful for ensuring that collections of objects don't contain duplicates based on specific identifying properties.
83+
84+
```json
85+
{
86+
"uniqueKeys": ["id", "name"]
87+
}
88+
```
89+
90+
This ensures that no two objects in the array have the same combination of values for the specified keys.
91+
7692
#### Objects
7793

7894
##### properties
@@ -171,7 +187,17 @@ is equivalent to the JSON schema
171187

172188
##### dependentRequired
173189

174-
_dependentRequired_ has been backported into cfn-lint. You can read the definition [here](https://json-schema.org/understanding-json-schema/reference/conditionals#dependentRequired)
190+
_dependentRequired_ has been backported into cfn-lint from JSON Schema 2019-09. It specifies that certain properties must be present if a given property is present.
191+
192+
```json
193+
{
194+
"dependentRequired": {
195+
"credit_card": ["billing_address"]
196+
}
197+
}
198+
```
199+
200+
This means that if the `credit_card` property is present, the `billing_address` property must also be present. You can read more about this keyword [here](https://json-schema.org/understanding-json-schema/reference/conditionals#dependentRequired).
175201

176202
##### dependentExcluded
177203

0 commit comments

Comments
 (0)