in src/ssmLanguageService.ts [90:106]
async doValidation(
document: JsonLS.TextDocument,
jsonDocument: JsonLS.JSONDocument,
documentSettings?: JsonLS.DocumentLanguageSettings | undefined,
schema?: JsonLS.JSONSchema | undefined
): Promise<JsonLS.Diagnostic[]> {
const diagnostics =
document.languageId === "ssm-json"
? await this.jsonLanguageService.doValidation(document, jsonDocument, documentSettings, schema)
: await this.yamlLanguageService.doValidation(document, false);
// vscode-json-languageservice and yaml-language-server will always set severity as warning for JSONSchema validation
// there is no option to configure this behavior so severity needs to be overwritten as error
return diagnostics.map((diagnostic) => {
diagnostic.severity = JsonLS.DiagnosticSeverity.Error;
return diagnostic;
});
}