diff --git a/src/cfnlint/data/schemas/patches/providers/all/aws_quicksight_dashboard/yaxis.json b/src/cfnlint/data/schemas/patches/providers/all/aws_quicksight_dashboard/yaxis.json new file mode 100644 index 0000000000..ce723281d8 --- /dev/null +++ b/src/cfnlint/data/schemas/patches/providers/all/aws_quicksight_dashboard/yaxis.json @@ -0,0 +1,20 @@ +[ + { + "op": "test", + "path": "/definitions/SingleAxisOptions/properties/YAxisOptions", + "value": { + "$ref": "#/definitions/YAxisOptions" + } + }, + { + "op": "replace", + "path": "/definitions/SingleAxisOptions/properties/YAxisOptions", + "value": { + "properties": { + "YAxis": { + "$ref": "#/definitions/SingleYAxisOption" + } + } + } + } +] diff --git a/src/cfnlint/data/schemas/patches/providers/all/aws_quicksight_template/yaxis.json b/src/cfnlint/data/schemas/patches/providers/all/aws_quicksight_template/yaxis.json new file mode 100644 index 0000000000..ce723281d8 --- /dev/null +++ b/src/cfnlint/data/schemas/patches/providers/all/aws_quicksight_template/yaxis.json @@ -0,0 +1,20 @@ +[ + { + "op": "test", + "path": "/definitions/SingleAxisOptions/properties/YAxisOptions", + "value": { + "$ref": "#/definitions/YAxisOptions" + } + }, + { + "op": "replace", + "path": "/definitions/SingleAxisOptions/properties/YAxisOptions", + "value": { + "properties": { + "YAxis": { + "$ref": "#/definitions/SingleYAxisOption" + } + } + } + } +] diff --git a/src/cfnlint/data/schemas/providers/us_east_1/aws-quicksight-dashboard.json b/src/cfnlint/data/schemas/providers/us_east_1/aws-quicksight-dashboard.json index 2b4e64c415..2a37d3ff6f 100644 --- a/src/cfnlint/data/schemas/providers/us_east_1/aws-quicksight-dashboard.json +++ b/src/cfnlint/data/schemas/providers/us_east_1/aws-quicksight-dashboard.json @@ -9314,7 +9314,11 @@ "additionalProperties": false, "properties": { "YAxisOptions": { - "$ref": "#/definitions/YAxisOptions" + "properties": { + "YAxis": { + "$ref": "#/definitions/SingleYAxisOption" + } + } } }, "type": "object" diff --git a/src/cfnlint/data/schemas/providers/us_east_1/aws-quicksight-template.json b/src/cfnlint/data/schemas/providers/us_east_1/aws-quicksight-template.json index ac09fd2fbe..e0ac9b6494 100644 --- a/src/cfnlint/data/schemas/providers/us_east_1/aws-quicksight-template.json +++ b/src/cfnlint/data/schemas/providers/us_east_1/aws-quicksight-template.json @@ -8932,7 +8932,11 @@ "additionalProperties": false, "properties": { "YAxisOptions": { - "$ref": "#/definitions/YAxisOptions" + "properties": { + "YAxis": { + "$ref": "#/definitions/SingleYAxisOption" + } + } } }, "type": "object" diff --git a/test/integration/test_schema_files.py b/test/integration/test_schema_files.py index a46e42ec04..7e435c8f5b 100644 --- a/test/integration/test_schema_files.py +++ b/test/integration/test_schema_files.py @@ -112,47 +112,47 @@ def validate_basic_schema_details( except RefResolutionError: self.fail(f"Can't find prop {prop} for {section} in {filepath}") - def _build_keywords( - self, obj: Any, schema_resolver: RefResolver, refs: list[str] | None = None - ): - if refs is None: - refs = [] + def _build_keywords(self, obj: Any, schema_resolver: RefResolver, refs: list[str]): if not isinstance(obj, dict): - yield [] + yield [], refs return if "type" in obj: if "object" in ensure_list(obj["type"]): if "properties" in obj: for k, v in obj["properties"].items(): - for item in self._build_keywords(v, schema_resolver, refs): - yield [k] + item + for item, refs in self._build_keywords( + v, schema_resolver, refs + ): + yield [k] + item, refs if "array" in ensure_list(obj["type"]): if "items" in obj: - for item in self._build_keywords( + for item, refs in self._build_keywords( obj["items"], schema_resolver, refs ): - yield ["*"] + item + yield ["*"] + item, refs if "$ref" in obj: ref = obj["$ref"] if ref in refs: - yield [] + yield [], refs return _, resolved_schema = schema_resolver.resolve(ref) - for item in self._build_keywords( - resolved_schema, schema_resolver, refs + [ref] + refs += [ref] + for item, refs in self._build_keywords( + resolved_schema, schema_resolver, refs ): - yield item + yield item, refs - yield [] + yield [], refs def build_keywords(self, schema_resolver): self._found_keywords.append( "/".join(["Resources", schema_resolver.referrer["typeName"], "Properties"]) ) + refs = [] for k, v in schema_resolver.referrer.get("properties").items(): - for item in self._build_keywords(v, schema_resolver): + for item, refs in self._build_keywords(v, schema_resolver, refs): self._found_keywords.append( "/".join( [