{
  "$schema": "http://json-schema.org/draft-04/schema#",

  /*

  Changelog:

  1.0
  - Initial Reqnroll configuration schema
  
  */

  "type": "object",
  "additionalProperties": true,
  "properties": {
    "language": {
      "description": "Use this section to define the default language for feature files and other language-related settings. For more details see https://docs.reqnroll.net/projects/reqnroll/en/latest/Installation/Configuration.html#language",
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "feature": {
          "description": "The default language of feature files added to the project. We recommend using specific culture names (e.g.: \"en-US\") rather than generic (neutral) cultures (e.g.: \"en\").",
          "type": "string",
          "default": "en-US"
        },
        "binding": {
          "description": "Specifies the culture to be used to execute binding methods and convert step arguments. If not specified, the feature language is used. We recommend using specific culture names (e.g.: \"en-US\") rather than generic (neutral) cultures (e.g.: \"en\").",
          "type": "string",
          "default": "not specified"
        }
      }
    },
    "generator": {
      "description": "Use this section to define unit test generation options. For more details see https://docs.reqnroll.net/projects/reqnroll/en/latest/Installation/Configuration.html#generator",
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "allowDebugGeneratedFiles": {
          "description": "By default, the debugger is configured to step through the generated code. This helps you debug your feature files and bindings. Disable this option by setting this attribute to \"true\".",
          "type": "boolean",
          "default": false
        },
        "allowRowTests": {
          "description": "Determines whether \"row tests\" should be generated for scenario outlines. This setting is ignored if the unit test framework does not support row based testing.",
          "type": "boolean",
          "default": false
        },
        "addNonParallelizableMarkerForTags": {
          "description": "Defines a set of tags, any of which specify that a feature should be excluded from running in parallel with any other feature. For mor details see https://docs.reqnroll.net/projects/reqnroll/en/latest/Execution/Parallel-Execution.html",
          "type": "array",
          "default": [],
          "items": {
            "type": "string"
          }
        }
      }
    },
    "runtime": {
      "description": "Use this section to specify various test execution options. For more details see https://docs.reqnroll.net/projects/reqnroll/en/latest/Installation/Configuration.html#runtime",
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "missingOrPendingStepsOutcome": {
          "description": "Determines how Reqnroll behaves if a step binding is not implemented or pending.",
          "type": "string",
          "default": "Pending",
          "enum": [ "Pending", "Inconclusive", "Ignore", "Error" ]
        },
        "obsoleteBehavior": {
          "description": "Determines how Reqnroll behaves if a step binding is marked with [Obsolete] attribute.",
          "type": "string",
          "default": "Warn",
          "enum": [ "None", "Warn", "Pending", "Error" ]
        },
        "stopAtFirstError": {
          "description": "Determines whether the execution should stop when encountering the first error, or whether it should attempt to try and match subsequent steps (in order to detect missing steps).",
          "type": "boolean",
          "default": false
        }
      }
    },
    "trace": {
      "description": "Use this section to determine the Reqnroll trace output. For more details see https://docs.reqnroll.net/projects/reqnroll/en/latest/Installation/Configuration.html#trace",
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "stepDefinitionSkeletonStyle": {
          "description": "Specifies the default step definition style.",
          "type": "string",
          "default": "CucumberExpressionAttribute",
          "enum": [ "CucumberExpressionAttribute", "RegexAttribute", "MethodNameUnderscores", "MethodNamePascalCase", "MethodNameRegex" ]
        },
        "coloredOutput": {
            "description": "Determine whether Reqnroll should color the test result output.",
            "type": "boolean",
            "default": false
        }
      }
    },
    "bindingAssemblies": {
      "description": "This section can be used to configure additional assemblies that contain external binding assemblies. The assembly of the Reqnroll project (the project containing the feature files) is automatically included. The binding assemblies must be placed in the output folder (e.g. bin/Debug) of the Reqnroll project, for example by adding a reference to the assembly from the project. For more details see https://go.reqnroll.net/doc-binding-assemblies",
      "type": "array",
      "default": [],
      "items": {
        "type": "object",
        "additionalProperties": true,
        "properties": {
          "assembly": {
            "description": "The name of the assembly containing bindings.",
            "type": "string"
          }
        }
      }
    },
    "ide": {
      "description": "This section contains all the extension configurations related to the IDE.",
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "reqnroll": {
          "$ref": "#/definitions/Reqnroll"
        },
        "traceability": {
          "$ref": "#/definitions/Traceability"
        },
        "editor": {
          "$ref": "#/definitions/Editor"
        }
      }
    },
    "$schema": {
      "type": "string"
    }
  },
  "definitions": {
    "Reqnroll": {
      "description": "Settings related to Reqnroll projects",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "isReqnrollProject": {
          "description": "Enables the project to be handled as Reqnroll project. (Default: [detect automatically])",
          "type": "boolean"
        },
        "configFilePath": {
          "description": "The path of the Reqnroll configuration file (App.config or reqnroll.json) used by the project, e.g. 'reqnroll.json'. (Default: [detect config file automatically])",
          "type": "string"
        },
        "version": {
          "description": "The Reqnroll version used by the project, e.g. '2.3.1'. (Default: [detect version automatically])",
          "type": "string",
          "pattern": "^(?:\\.?[0-9]+){2,}(?:\\-[\\-a-z0-9]*)?$"
        },
        "traits": {
          "description": "The list of the Reqnroll-related project traits. The possible traits are: 'MsBuildGeneration', 'XUnitAdapter', 'DesignTimeFeatureFileGeneration', e.g. '[\"XUnitAdapter\"]'. (Default: [detect from the installed NuGet packages])",
          "type": "array",
          "items": {
            "enum": [ "None", "MsBuildGeneration", "XUnitAdapter", "DesignTimeFeatureFileGeneration" ]
          }
        }
      }
    },

    "Traceability": {
      "description": "Settings for traceability of scenarios, see http://speclink.me/deveroomtraceability for details.",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "tagLinks": {
          "description": "List of tags patterns that should be converted to an external URL",
          "type": "array",
          "items": {
            "type": "object",
            "description": "Tag pattern configuration",
            "additionalProperties": false,
            "properties": {
              "tagPattern": {
                "description": "A regular expression that matches to the tag name (without leading '@' sign). The identifier of the artifacts should be matched with a named regex group. E.g. 'issue\\\\:(?<id>\\\\d+)'. ",
                "type": "string"
              },
              "urlTemplate": {
                "description": "An URL template to generate the external link. It can contain parameters in an '{paramName}' format, where 'paramName' refers to the regular expression group name in the 'tagPattern'. E.g. 'https://github.com/me/my-project/issues/{id}'",
                "type": "string"
              }
            },
            "required": [ "tagPattern", "urlTemplate" ]
          }
        }
      }
    },

    "Editor": {
      "description": "This section contains all the Editor related configurations.",
      "type": "object",
      "additionalProperties": true,
      "properties": {
        "showStepCompletionAfterStepKeywords": {
          "description": "Determines whether the extension should suggest step completions.",
          "type": "boolean",
          "default": true
        },
        "gherkinFormat": {
          "description": "Provides settings for formatting Gherkin feature files",
          "type": "object",
          "additionalItems": true,
          "properties": {
            "indentFeatureChildren": {
              "description": "Specifies whether child elements of Feature (Background, Rule, Scenario, Scenario Outline) should be indented.",
              "type": "boolean",
              "default": false
            },
            "indentRuleChildren": {
              "description": "Specifies whether child elements fo Rule (Background, Scenario, Scenario Outline) should be indented.",
              "type": "boolean",
              "default": false
            },
            "indentSteps": {
              "description": "Specifies whether steps of scenarios should be indented.",
              "type": "boolean",
              "default": true
            },
            "indentAndSteps": {
              "description": "Specifies whether the 'And' and 'But' steps of the scenarios should have an additional indentation.",
              "type": "boolean",
              "default": false
            },
            "indentDataTable": {
              "description": "Specifies whether DataTable arguments should be indented within the step.",
              "type": "boolean",
              "default": true
            },
            "indentDocString": {
              "description": "Specifies whether DocString arguments should be indented within the step.",
              "type": "boolean",
              "default": true
            },
            "indentExamples": {
              "description": "Specifies whether the Examples block should be indented within the Scenario Outline.",
              "type": "boolean",
              "default": false
            },
            "indentExamplesTable": {
              "description": "Specifies whether the Examples table should be indented within the Examples block.",
              "type": "boolean",
              "default": true
            },
            "tableCellPaddingSize": {
              "description": "The number of space characters to be used on each sides as table cell padding.",
              "type": "integer",
              "default": 1
            }
          }
        }
      }
    } 
  }
}
