JSON schema

In this tutorial you will learn to add a JSON schema to get autocompletion support when writing policy files with VS Code.

A JSON schema reference enables VS Code IntelliSense to provide autocomplete, validation and documentation for security.manager NEXT policy files. This helps prevent syntax errors and ensures policy structure compliance.

This tutorial was tested for ArcGIS Enterprise 11.5 in December, 2025.

Prerequisites

Check the preconditions for this tutorial:

  • VS Code is installed on your local machine.

  • Git is installed on your local machine.

  • You have a GitHub account. This account is connected to VS Code.

  • You have a GitHub repository as described in Set up a GitHub Repository.

Add schema reference

To use VS Code IntelliSense, add a reference to the JSON schema to the policy file.

  1. Open the policy file SampleWorldCities.json in the services folder.

  2. Add the JSON Schema reference at the top of the file for IntelliSense support:

    { 
        "$schema": "https://raw.githubusercontent.com/conterra/policies-json/1.7.0/schema/policies.schema.json",(1)
        "fallbackPolicies": [{
            "layers": [
                "0"
            ],
            "restrictions": ["cities_only_names", "cities_username_filter"]
    1 Insert the $schema property with the URL to the JSON schema.

Verify configuration

Now you can test the IntelliSense functionality.

  1. Position your cursor in the JSON file, e.g., after the fallbackPolicies entry and before the restrictions entry.

  2. Try typing new policy elements and observe the autocomplete suggestions.

    1. Press Ctrl+Space to trigger IntelliSense help and see available options.

    2. Select policies from the suggestions to explore the structure.

    3. The JSON schema provides validation and IntelliSense support for the policy structure.

If IntelliSense does not work, check if the link is correct and the validation is not disabled in VS Code .

Commit and push changes

Commit and push your changes to GitHub.

  1. In VS Code, go to the Source Control view by pressing Ctrl+Shift+G.

  2. Review the changed file: policies/services/SampleWorldCities.json.

  3. Enter a commit message Add schema reference to SampleWorldCities policy.

  4. Click Commit to stage and commit changes.

  5. Click Sync Changes or use Ctrl+Shift+P and select Git: Push to push to GitHub.

Verify the repository updates in the web browser.

  1. Go to your GitHub repository in the web browser.

  2. Navigate to the policies/services/ folder.

  3. Verify that SampleWorldCities.json is present and includes the schema reference.

Summary

In this tutorial, you learned how to add a JSON schema to activate VS Code IntelliSense.

Follow GitHub Actions to learn how to define a GitHub Action to automatically synchronize the policies.