Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Schema validation for Adaptive cards #2062

Merged
merged 3 commits into from
Aug 30, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions src/app/views/common/monaco/Monaco.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FocusZone } from '@fluentui/react';
import Editor, { OnChange } from '@monaco-editor/react';
import React from 'react';
import Editor, { OnChange, useMonaco } from '@monaco-editor/react';
import React, { useEffect } from 'react';

import { ThemeContext } from '../../../../themes/theme-context';
import './monaco.scss';
Expand All @@ -26,6 +26,19 @@ export function Monaco(props: IMonaco) {
}
const itemHeight = height ? height : '300px';

const monaco = useMonaco();
useEffect(() => {
if (monaco) {
monaco.languages.json.jsonDefaults.setDiagnosticsOptions({
validate: true,
allowComments: false,
schemas: [],
enableSchemaRequest: true,
schemaRequest: 'ignore'
});
}
}, [monaco]);

return (
<FocusZone disabled={props.extraInfoElement ? false : true}>
<div className='monaco-editor'>
Expand Down