Repository: microsoft/terminal (language: cpp)

Issue:
Recurring vscode JSON validation issues
Recently started using Windows Terminal to try and bring all shells to one place. And it does its job perfectly, even allowing me to run an MSYS2 env at the click of a button! However, when editing the `settings.json` I noticed a couple validation warnings.

First off: `Matches multiple schemas when only one must validate.`
You guessed it, the `"backgroundImage"` key is acting up again, just like in 2019's #3909 which was supposedly fixed with #4045
Flagged in `settings.json` > `"profiles"` > `"defaults"` && `"list"` > `*`
Does **not** get flagged when put next to `"profiles"` (so in the top level of `settings.json`), while this _should_ cause the JSON to not validate at all.

Next up is a repeat of #11629 `Property intenseTextStyle is not allowed.` which was closed due to the issue going stale.
This gets flagged in `settings.json` > `"profiles"` > `"defaults"` && `"list"` > `*`
Does **not** get flagged when put next to `"profiles"` (so in the top level of `settings.json`), while this _should_ cause the JSON to not validate at all.

![image](https://user-images.githubusercontent.com/14993038/175920255-8737093a-a1c4-4cc1-aeb2-97d010b2b0b2.png)

If requested, I can try other validators to see if the issue lies in vscode instead of here. Opted to open it here first because 3909 was also flagged and fixed as being a JSON schema issue

For completeness sake, let me add:
Windows Terminal version 1.13.11431.0
OS: Microsoft Windows [Version 10.0.19044.1766]


Discussion / hints:
It appears that `intenseTextStyle` is listed in `#/$defs/AppearanceConfig` but not `#/$defs/Profile` -- that one is very straightforward at least.
The [JSON Schema Validator](https://www.jsonschemavalidator.net/) doesnt seem to complain about it. Maybe a VSCode issue?

<img width="1194" alt="image" src="https://github.com/microsoft/terminal/assets/2086722/9a3d5725-65b5-4edb-88e3-80d70a019c15">

<img width="1195" alt="image" src="https://github.com/microsoft/terminal/assets/2086722/f333ab96-fb1e-44f4-8620-1ea2a8015197">

hello 
is this issue is fixed?
In the latest VS Code and Windows Terminal I can't see any issues either. @zadjii-msft are you okay with closing this as well?

Fix patch:
diff --git a/doc/cascadia/profiles.schema.json b/doc/cascadia/profiles.schema.json
index 9dc3a8afd58..cb85597e24a 100644
--- a/doc/cascadia/profiles.schema.json
+++ b/doc/cascadia/profiles.schema.json
@@ -86,12 +86,19 @@
       ]
     },
     "BuiltinSuggestionSource": {
-      "enum": [
-        "commandHistory",
-        "tasks",
-        "all"
-      ],
-      "type": "string"
+      "type": "string",
+      "anyOf": [
+        {
+          "type": "string"
+        },
+        {
+          "enum": [
+            "commandHistory",
+            "tasks",
+            "all"
+          ]
+        }
+      ]
     },
     "SuggestionSource": {
       "default": "all",
@@ -99,15 +106,17 @@
       "$comment": "`tasks` and `local` are sources that would be added by the Tasks feature, as a follow-up",
       "oneOf": [
         {
-          "type": [ "string", "null", "BuiltinSuggestionSource" ]
+          "type": "null"
         },
         {
-          "type": "array",
-          "items": { "type": "BuiltinSuggestionSource" }
+          "$ref": "#/$defs/BuiltinSuggestionSource"
         },
         {
           "type": "array",
-          "items": { "type": "string" }
+          "items": {
+            "$ref": "#/$defs/BuiltinSuggestionSource"
+          },
+          "uniqueItems": true
         }
       ]
     },
@@ -201,10 +210,6 @@
                 "desktopWallpaper"
               ]
             }
-          ],
-          "type": [
-            "string",
-            "null"
           ]
         },
         "backgroundImageOpacity": {
@@ -270,7 +275,7 @@
           "description": "Use to set a path to a pixel shader to use with the Terminal when unfocused. Overrides `experimental.retroTerminalEffect`. This is an experimental feature, and its continued existence is not guaranteed.",
           "type": "string"
         },
-        "useAcrylic":{
+        "useAcrylic": {
           "description": "When set to true, the window will have an acrylic material background when unfocused. When set to false, the window will have a plain, untextured background when unfocused.",
           "type": "boolean"
         }
@@ -645,6 +650,7 @@
           "$ref": "#/$defs/NewTabMenuEntry"
         },
         {
+          "type": "object",
           "properties": {
             "type": {
               "type": "string",
@@ -687,6 +693,7 @@
           "$ref": "#/$defs/NewTabMenuEntry"
         },
         {
+          "type": "object",
           "properties": {
             "type": {
               "type": "string",
@@ -703,6 +710,7 @@
           "$ref": "#/$defs/NewTabMenuEntry"
         },
         {
+          "type": "object",
           "properties": {
             "type": {
               "type": "string",
@@ -724,6 +732,7 @@
           "$ref": "#/$defs/NewTabMenuEntry"
         },
         {
+          "type": "object",
           "properties": {
             "type": {
               "type": "string",
@@ -740,6 +749,7 @@
           "$ref": "#/$defs/NewTabMenuEntry"
         },
         {
+          "type": "object",
           "properties": {
             "type": {
               "type": "string",
@@ -780,6 +790,7 @@
       ]
     },
     "ShortcutAction": {
+      "type": "object",
       "properties": {
         "action": {
           "description": "The action to execute",
@@ -788,8 +799,7 @@
       },
       "required": [
         "action"
-      ],
-      "type": "object"
+      ]
     },
     "AdjustFontSizeAction": {
       "description": "Arguments corresponding to an Adjust Font Size Action",
@@ -798,6 +808,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -822,6 +833,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -863,6 +875,7 @@
           "$ref": "#/$defs/NewTerminalArgs"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -879,6 +892,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -903,6 +917,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -927,6 +942,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -951,6 +967,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -975,6 +992,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -999,6 +1017,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1023,6 +1042,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1050,6 +1070,7 @@
           "$ref": "#/$defs/NewTerminalArgs"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1082,6 +1103,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1119,6 +1141,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1146,6 +1169,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1167,6 +1191,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1188,6 +1213,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1212,6 +1238,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1232,6 +1259,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1252,6 +1280,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1272,6 +1301,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1296,6 +1326,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1324,6 +1355,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1352,6 +1384,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1380,6 +1413,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1404,6 +1438,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1428,6 +1463,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1451,6 +1487,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1476,6 +1513,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1497,6 +1535,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1524,6 +1563,7 @@
           "$ref": "#/$defs/NewTerminalArgs"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1540,6 +1580,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1561,6 +1602,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1582,6 +1624,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1603,6 +1646,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1624,6 +1668,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1646,6 +1691,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1667,6 +1713,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1688,6 +1735,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1739,6 +1787,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1755,6 +1804,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1778,6 +1828,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1806,6 +1857,7 @@
           "$ref": "#/$defs/ShortcutAction"
         },
         {
+          "type": "object",
           "properties": {
             "action": {
               "type": "string",
@@ -1892,7 +1944,11 @@
       "properties": {
         "applicationTheme": {
           "description": "Which UI theme the Terminal should use for controls",
-          "enum": [ "light", "dark", "system" ],
+          "enum": [
+            "light",
+            "dark",
+            "system"
+          ],
           "type": "string"
         },
         "useMica": {
@@ -1923,7 +1979,11 @@
           "type": "string",
           "description": "The name of the theme. This will be displayed in the settings UI.",
           "not": {
-            "enum": [ "light", "dark", "system" ]
+            "enum": [
+              "light",
+              "dark",
+              "system"
+            ]
           }
         },
         "tab": {
@@ -1940,6 +2000,7 @@
     "ThemePair": {
       "additionalProperties": false,
       "description": "A pair of Theme names, to allow the Terminal to switch theme based on the OS theme",
+      "type": "object",
       "properties": {
         "light": {
           "type": "string",
@@ -2121,16 +2182,16 @@
         },
         "name": {
           "description": "The name that will appear in the command palette. If one isn't provided, the terminal will attempt to automatically generate a name.\nIf name is a string, it will be the name of the command.\nIf name is a object, the key property of the object will be used to lookup a localized string resource for the command",
-          "properties": {
-            "key": {
-              "type": "string"
-            }
-          },
           "type": [
             "string",
             "object",
             "null"
-          ]
+          ],
+          "properties": {
+            "key": {
+              "type": "string"
+            }
+          }
         },
         "iterateOn": {
           "type": "string",
@@ -2167,6 +2228,7 @@
     "Globals": {
       "additionalProperties": true,
       "description": "Properties that affect the entire window, regardless of the profile settings.",
+      "type": "object",
       "properties": {
         "alwaysOnTop": {
           "default": false,
@@ -2178,7 +2240,7 @@
           "description": "When set to true, tabs are always displayed. When set to false and \"showTabsInTitlebar\" is set to false, tabs only appear after opening a new tab.",
           "type": "boolean"
         },
-        "compatibility.enableUnfocusedAcrylic":{
+        "compatibility.enableUnfocusedAcrylic": {
           "default": true,
           "description": "When set to true, unfocused windows can have acrylic instead of opaque.",
           "type": "boolean"
@@ -2381,10 +2443,17 @@
         "theme": {
           "default": "dark",
           "description": "Sets the theme of the application. This value should be the name of one of the themes defined in `themes`. The Terminal also includes the themes `dark`, `light`, and `system`.",
-          "oneOf": [
+          "anyOf": [
             {
               "type": "string"
             },
+            {
+              "enum": [
+                "dark",
+                "light",
+                "system"
+              ]
+            },
             {
               "$ref": "#/$defs/ThemePair"
             }
@@ -2494,12 +2563,12 @@
       },
       "required": [
         "defaultProfile"
-      ],
-      "type": "object"
+      ]
     },
     "Profile": {
       "description": "Properties specific to a unique profile.",
       "additionalProperties": false,
+      "type": "object",
       "properties": {
         "acrylicOpacity": {
           "default": 0.5,
@@ -2551,7 +2620,7 @@
         },
         "backgroundImage": {
           "description": "Sets the file location of the image to draw over the window background.",
-          "oneOf": [
+          "anyOf": [
             {
               "type": [
                 "string",
@@ -2563,10 +2632,6 @@
                 "desktopWallpaper"
               ]
             }
-          ],
-          "type": [
-            "string",
-            "null"
           ]
         },
         "backgroundImageAlignment": {
@@ -2903,8 +2968,7 @@
           "description": "When set to true, the window will have an acrylic material background. When set to false, the window will have a plain, untextured background.",
           "type": "boolean"
         }
-      },
-      "type": "object"
+      }
     },
     "ProfileList": {
       "description": "A list of profiles and the properties specific to each.",
@@ -2919,6 +2983,7 @@
     },
     "ProfilesObject": {
       "description": "A list of profiles and default settings that apply to all of them",
+      "type": "object",
       "properties": {
         "list": {
           "$ref": "#/$defs/ProfileList"
@@ -2927,12 +2992,12 @@
           "description": "The default settings that apply to every profile.",
           "$ref": "#/$defs/Profile"
         }
-      },
-      "type": "object"
+      }
     },
     "SchemeList": {
       "description": "Properties are specific to each color scheme. ColorTool is a great tool you can use to create and explore new color schemes. All colors use hex color format.",
       "items": {
+        "type": "object",
         "additionalProperties": false,
         "properties": {
           "name": {
@@ -3021,8 +3086,7 @@
             "$ref": "#/$defs/Color",
             "description": "Sets the color used as ANSI yellow."
           }
-        },
-        "type": "object"
+        }
       },
       "type": "array"
     }
@@ -3032,6 +3096,7 @@
       "$ref": "#/$defs/Globals"
     },
     {
+      "type": "object",
       "additionalItems": true,
       "properties": {
         "profiles": {


Test patch: