Search code examples
angular-cliwebstormjsonschemaangular-schematics

Enable angular.json schema for WebStorm 2020.1.2


For some reason angular.json (@angular/[email protected]) schema is not loaded by WebStorm 2020.1.2. This makes customizing angular.json much harder. This was working in older WebStorm version.

I tried adding the angular.json schema manually, still no success there. Check the attached image bellow.

How to make angular.json schema work in WebStorm 2020.1.2?

WebStorm Settings


Solution

  • To add an Angular JSON schema in IDEA/WebStorm 2020.2:

    1. Go to: File | Settings | Languages & Frameworks | Schemas and DTDs | JSON Schema Mappings.

    2. In the upper left corner, click on + to add a new schema.

    3. Provide a schema name.

    4. In Schema file or URL, set: https://raw.githubusercontent.com/angular/angular-cli/master/packages/angular/cli/lib/config/schema.json.

    5. In Schema version, set JSON Schema version 7.

    6. On the right side of the Settings window, click on + to add all JSON files, which should be processed with this JSON schema:
      JSON Schema Mappings

    7. Press Apply.

    That's all! Now IDEA/WebStorm will process your JSONs with the Angular JSON schema including the code suggestions and schema validation:

    A schema-processed angular.json

    It's also possible to assign a JSON schema via the bottom right corner, click on No JSON schema and select the schema name, you've provided in the step #3:

    Angular JSON Schema