# Presets should ignore the toplevel "$schema" entry

**URL:** https://discourse.cmake.org/t/presets-should-ignore-the-toplevel-schema-entry/3025
**Category:** Usage
**Created:** [March 26, 2021, 10:33am UTC](https://discourse.cmake.org/t/presets-should-ignore-the-toplevel-schema-entry/3025 "2021-03-26T10:33:14Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![objectx](https://discourse.cmake.org/user_avatar/discourse.cmake.org/objectx/32/1067_2.png) [@objectx](https://discourse.cmake.org/u/objectx)
#### Post date: [March 26, 2021, 10:33am UTC](https://discourse.cmake.org/t/presets-should-ignore-the-toplevel-schema-entry/3025/1 "2021-03-26T10:33:15Z")

</div>

To utilize the VSCode’s JSON completion, The CMakePresets.json must contain the “$schema” entry at the top-level. But cmake.exe refuses this ( 😥 say “Invalid root object”).

---

<div class="post-metadata">

### Author: ![kyle.edwards](https://discourse.cmake.org/letter_avatar_proxy/v4/letter/k/65b543/32.png) [@kyle.edwards](https://discourse.cmake.org/u/kyle.edwards)
#### Post date: [March 26, 2021, 2:36pm UTC](https://discourse.cmake.org/t/presets-should-ignore-the-toplevel-schema-entry/3025/2 "2021-03-26T14:36:44Z")

</div>

In my opinion, the VSCode extension should recognize `CMakePresets.json` and `CMakeUserPresets.json`, and apply the appropriate schema automatically. Nevertheless, perhaps it does make sense to allow a `$schema` key anyway.

---

<div class="post-metadata">

### Author: ![objectx](https://discourse.cmake.org/user_avatar/discourse.cmake.org/objectx/32/1067_2.png) [@objectx](https://discourse.cmake.org/u/objectx)
#### Post date: [April 27, 2021, 6:43am UTC](https://discourse.cmake.org/t/presets-should-ignore-the-toplevel-schema-entry/3025/3 "2021-04-27T06:43:59Z")

</div>

Now VSCode knows about the [CMakePresets.json schama](https://github.com/microsoft/vscode-cmake-tools/pull/1725).
