Skip to content

presets: Add $schema property to JSON schema

ChenMoFeiJin requested to merge (removed):master into master

In JSON, the $schema keyword is used to declare the version of JSON Schema and metadata that the current JSON document adheres to. This can help JSON validators understand how to parse and validate the JSON document.

By adding the $schema property, you can specify the JSON Schema that the CMakePresets.json file should adhere to. This way, when you use a JSON validator to validate the CMakePresets.json file, the validator knows which rules to use for validation.

Many modern code editors (like Visual Studio Code) have support for JSON Schema. When you specify the $schema property in a JSON file, the editor can provide features like auto-completion, error checking, etc., which can improve your efficiency when writing and modifying the CMakePresets.json file.

Therefore, adding the $schema property to the JSON Schema of CMakePresets.json can help improve development efficiency and ensure code quality.


Before

Current Status

After

image.png


Topic-rename: presets-schema

Edited by ChenMoFeiJin

Merge request reports