Skip to content

Commit 3001eb5

Browse files
authored
Convert json resource properties into better json schem validation (#3423)
* JSON object type cleanup * Convert all json properties to support string too
1 parent 1e78b4c commit 3001eb5

File tree

776 files changed

+9099
-1299
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

776 files changed

+9099
-1299
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@ repos:
2424
hooks:
2525
- id: isort
2626
- repo: https://github.com/charliermarsh/ruff-pre-commit
27-
rev: "v0.4.4"
27+
rev: "v0.4.10"
2828
hooks:
2929
- id: ruff
3030
- repo: https://github.com/PyCQA/bandit
31-
rev: "1.7.8"
31+
rev: "1.7.9"
3232
hooks:
3333
- id: bandit
3434
additional_dependencies:
3535
- "bandit[toml]"
3636
args: ["-c", "pyproject.toml"]
3737
- repo: https://github.com/pre-commit/mirrors-mypy
38-
rev: "v1.10.0"
38+
rev: "v1.10.1"
3939
hooks:
4040
- id: mypy
4141
additional_dependencies:
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"etag": "\"77f8f0ff694760d9d86001ab4dca1909\"", "url": "https://schema.cloudformation.us-gov-west-1.amazonaws.com/CloudformationSchema.zip"}
1+
{"etag": "\"cab7c18393919e17ef44d9fca8c62008\"", "url": "https://schema.cloudformation.us-gov-west-1.amazonaws.com/CloudformationSchema.zip"}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{"etag": "\"bb135f465b3346b7dea602d254e4c44c\"", "url": "https://schema.cloudformation.ca-west-1.amazonaws.com/CloudformationSchema.zip"}
1+
{"etag": "\"ca78dae4bedfa5f1574d2d0cafd31df2\"", "url": "https://schema.cloudformation.ca-west-1.amazonaws.com/CloudformationSchema.zip"}

src/cfnlint/data/schemas/patches/providers/all/alexa_ask_skill/__init__.py

Whitespace-only changes.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[
2+
{
3+
"op": "test",
4+
"path": "/definitions/Overrides/properties/Manifest",
5+
"value": {
6+
"type": "object"
7+
}
8+
},
9+
{
10+
"op": "replace",
11+
"path": "/definitions/Overrides/properties/Manifest",
12+
"value": {
13+
"format": "json",
14+
"type": [
15+
"object",
16+
"string"
17+
]
18+
}
19+
}
20+
]

src/cfnlint/data/schemas/patches/providers/all/aws_apigateway_model/__init__.py

Whitespace-only changes.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[
2+
{
3+
"op": "test",
4+
"path": "/properties/Schema",
5+
"value": {
6+
"type": "object"
7+
}
8+
},
9+
{
10+
"op": "replace",
11+
"path": "/properties/Schema",
12+
"value": {
13+
"format": "json",
14+
"type": [
15+
"object",
16+
"string"
17+
]
18+
}
19+
}
20+
]

src/cfnlint/data/schemas/patches/providers/all/aws_apigateway_restapi/__init__.py

Whitespace-only changes.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[
2+
{
3+
"op": "test",
4+
"path": "/properties/Body",
5+
"value": {
6+
"type": "object"
7+
}
8+
},
9+
{
10+
"op": "replace",
11+
"path": "/properties/Body",
12+
"value": {
13+
"format": "json",
14+
"type": [
15+
"object",
16+
"string"
17+
]
18+
}
19+
}
20+
]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[
2+
{
3+
"op": "test",
4+
"path": "/properties/Policy",
5+
"value": {
6+
"type": "object"
7+
}
8+
},
9+
{
10+
"op": "replace",
11+
"path": "/properties/Policy",
12+
"value": {
13+
"format": "json",
14+
"type": [
15+
"object",
16+
"string"
17+
]
18+
}
19+
}
20+
]

src/cfnlint/data/schemas/patches/providers/all/aws_apigatewayv2_api/__init__.py

Whitespace-only changes.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[
2+
{
3+
"op": "test",
4+
"path": "/properties/Body",
5+
"value": {
6+
"type": "object"
7+
}
8+
},
9+
{
10+
"op": "replace",
11+
"path": "/properties/Body",
12+
"value": {
13+
"format": "json",
14+
"type": [
15+
"object",
16+
"string"
17+
]
18+
}
19+
}
20+
]
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[
2+
{
3+
"op": "test",
4+
"path": "/properties/Tags",
5+
"value": {
6+
"type": "object"
7+
}
8+
},
9+
{
10+
"op": "replace",
11+
"path": "/properties/Tags",
12+
"value": {
13+
"additionalProperties": false,
14+
"patternProperties": {
15+
".*": {
16+
"type": "string"
17+
}
18+
},
19+
"type": "object"
20+
}
21+
}
22+
]

src/cfnlint/data/schemas/patches/providers/all/aws_apigatewayv2_apigatewaymanagedoverrides/__init__.py

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[
2+
{
3+
"op": "test",
4+
"path": "/definitions/StageOverrides/properties/RouteSettings",
5+
"value": {
6+
"type": "object"
7+
}
8+
},
9+
{
10+
"op": "replace",
11+
"path": "/definitions/StageOverrides/properties/RouteSettings",
12+
"value": {
13+
"format": "json",
14+
"type": [
15+
"object",
16+
"string"
17+
]
18+
}
19+
}
20+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[
2+
{
3+
"op": "test",
4+
"path": "/definitions/StageOverrides/properties/StageVariables",
5+
"value": {
6+
"type": "object"
7+
}
8+
},
9+
{
10+
"op": "replace",
11+
"path": "/definitions/StageOverrides/properties/StageVariables",
12+
"value": {
13+
"format": "json",
14+
"type": [
15+
"object",
16+
"string"
17+
]
18+
}
19+
}
20+
]

src/cfnlint/data/schemas/patches/providers/all/aws_apigatewayv2_domainname/__init__.py

Whitespace-only changes.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[
2+
{
3+
"op": "test",
4+
"path": "/properties/Tags",
5+
"value": {
6+
"type": "object"
7+
}
8+
},
9+
{
10+
"op": "replace",
11+
"path": "/properties/Tags",
12+
"value": {
13+
"additionalProperties": false,
14+
"patternProperties": {
15+
".*": {
16+
"type": "string"
17+
}
18+
},
19+
"type": "object"
20+
}
21+
}
22+
]

src/cfnlint/data/schemas/patches/providers/all/aws_apigatewayv2_integration/__init__.py

Whitespace-only changes.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[
2+
{
3+
"op": "test",
4+
"path": "/properties/RequestParameters",
5+
"value": {
6+
"type": "object"
7+
}
8+
},
9+
{
10+
"op": "replace",
11+
"path": "/properties/RequestParameters",
12+
"value": {
13+
"format": "json",
14+
"type": [
15+
"object",
16+
"string"
17+
]
18+
}
19+
}
20+
]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[
2+
{
3+
"op": "test",
4+
"path": "/properties/RequestTemplates",
5+
"value": {
6+
"type": "object"
7+
}
8+
},
9+
{
10+
"op": "replace",
11+
"path": "/properties/RequestTemplates",
12+
"value": {
13+
"format": "json",
14+
"type": [
15+
"object",
16+
"string"
17+
]
18+
}
19+
}
20+
]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[
2+
{
3+
"op": "test",
4+
"path": "/properties/ResponseParameters",
5+
"value": {
6+
"type": "object"
7+
}
8+
},
9+
{
10+
"op": "replace",
11+
"path": "/properties/ResponseParameters",
12+
"value": {
13+
"format": "json",
14+
"type": [
15+
"object",
16+
"string"
17+
]
18+
}
19+
}
20+
]

src/cfnlint/data/schemas/patches/providers/all/aws_apigatewayv2_integrationresponse/__init__.py

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[
2+
{
3+
"op": "test",
4+
"path": "/properties/ResponseParameters",
5+
"value": {
6+
"type": "object"
7+
}
8+
},
9+
{
10+
"op": "replace",
11+
"path": "/properties/ResponseParameters",
12+
"value": {
13+
"format": "json",
14+
"type": [
15+
"object",
16+
"string"
17+
]
18+
}
19+
}
20+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[
2+
{
3+
"op": "test",
4+
"path": "/properties/ResponseTemplates",
5+
"value": {
6+
"type": "object"
7+
}
8+
},
9+
{
10+
"op": "replace",
11+
"path": "/properties/ResponseTemplates",
12+
"value": {
13+
"format": "json",
14+
"type": [
15+
"object",
16+
"string"
17+
]
18+
}
19+
}
20+
]

src/cfnlint/data/schemas/patches/providers/all/aws_apigatewayv2_model/__init__.py

Whitespace-only changes.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[
2+
{
3+
"op": "test",
4+
"path": "/properties/Schema",
5+
"value": {
6+
"type": "object"
7+
}
8+
},
9+
{
10+
"op": "replace",
11+
"path": "/properties/Schema",
12+
"value": {
13+
"format": "json",
14+
"type": [
15+
"object",
16+
"string"
17+
]
18+
}
19+
}
20+
]

src/cfnlint/data/schemas/patches/providers/all/aws_apigatewayv2_route/__init__.py

Whitespace-only changes.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[
2+
{
3+
"op": "test",
4+
"path": "/properties/RequestModels",
5+
"value": {
6+
"type": "object"
7+
}
8+
},
9+
{
10+
"op": "replace",
11+
"path": "/properties/RequestModels",
12+
"value": {
13+
"format": "json",
14+
"type": [
15+
"object",
16+
"string"
17+
]
18+
}
19+
}
20+
]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[
2+
{
3+
"op": "test",
4+
"path": "/properties/RequestParameters",
5+
"value": {
6+
"type": "object"
7+
}
8+
},
9+
{
10+
"op": "replace",
11+
"path": "/properties/RequestParameters",
12+
"value": {
13+
"format": "json",
14+
"type": [
15+
"object",
16+
"string"
17+
]
18+
}
19+
}
20+
]

src/cfnlint/data/schemas/patches/providers/all/aws_apigatewayv2_routeresponse/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)