Autocomplete Feature for Application Configuration YAML File

ActiveMatrix Service Grid - Container Edition ships JSON schema which gives you the auto-completion feature when editing the application configuration YAML file in an editor. This schema is generated according to the YAML structure that is required to create the image. For the current release, this feature does not do schema validation to display errors in YAML file, but for ADD or UPDATE operation it displays the required parameter error for an entity.

When editing the application configuration YAML file, you can get suggestions of the remaining parameters of an entity. You can add or update the required entity with autocomplete. For more information about the application configuration YAML file, see Understanding Application Configuration YAML File.

Using the JSON Schema in Visual Studio Code Editor

Currently, JSON schema supports the Visual Studio Code editor only. The JSON Schema .zip file is provided in the folder amsgce-runtime-<version>/jsonschema/JsonSchema.zip.

Procedure

  1. Extract JsonSchema.zip to your local machine. Note the absolute path to amxce_schema.json.
  2. Install the YAML plugin in Visual Studio Code. Restart Visual Studio Code.
  3. In Visual Studio Code, navigate to File > Preferences > Settings. Search yaml in the search bar. Click the Edit in setting.json link.
  4. Add the following mapping in the settings.json. The location must be the absolute path to the schema file on your system. Replace the <location> with the path that you noted in Step 2, which is the absolute path to amxce_schema.json file.

    Add below mapping in settings.json
    
    {
        "yaml.schemas": {
            "<location>/amxce_schema.json": ["/*.config.yaml"],
        }
    }

    If you are using Microsoft Windows Operating System, add slash'/' before the absolute path. For example: /C:/schema/amxce_schema.json

  5. Save settings.json and restart Visual Studio Code.

When you create a new .config.yaml file and press CTRL + Space, Visual Studio Code displays the suggestions based on the schema amxce_schema.json and parameters specific to the application DAA.