diff --git a/src/core/components/param-body.jsx b/src/core/components/param-body.jsx index 6ee9e76de03..c440ebfb823 100644 --- a/src/core/components/param-body.jsx +++ b/src/core/components/param-body.jsx @@ -2,6 +2,7 @@ import React, { PureComponent } from "react" import PropTypes from "prop-types" import { fromJS, List } from "immutable" import { getSampleSchema } from "core/utils" +import { getKnownSyntaxHighlighterLanguage } from "core/utils/jsonParse" const NOOP = Function.prototype @@ -112,6 +113,11 @@ export default class ParamBody extends PureComponent { let consumes = this.props.consumes && this.props.consumes.size ? this.props.consumes : ParamBody.defaultProp.consumes let { value, isEditBox } = this.state + let language = null + let testValueForJson = getKnownSyntaxHighlighterLanguage(value) + if (testValueForJson) { + language = "json" + } return (
@@ -119,8 +125,9 @@ export default class ParamBody extends PureComponent { isEditBox && isExecute ?