/** * @prettier */ import React from "react" import PropTypes from "prop-types" import { sanitizeUrl } from "core/utils" const JsonSchemaDialect = ({ getComponent, specSelectors }) => { const jsonSchemaDialect = specSelectors.selectJsonSchemaDialectField() const jsonSchemaDialectDefault = specSelectors.selectJsonSchemaDialectDefault() // prettier-ignore const Link = getComponent("Link") return ( <> {jsonSchemaDialect && jsonSchemaDialect === jsonSchemaDialectDefault && (

JSON Schema dialect:{" "} {jsonSchemaDialect}

)} {jsonSchemaDialect && jsonSchemaDialect !== jsonSchemaDialectDefault && (

Warning

OpenAPI.jsonSchemaDialect field contains a value different from the default value of{" "} {jsonSchemaDialectDefault} . Values different from the default one are currently not supported. Please either omit the field or provide it with the default value.

)} ) } JsonSchemaDialect.propTypes = { getComponent: PropTypes.func.isRequired, specSelectors: PropTypes.shape({ selectJsonSchemaDialectField: PropTypes.func.isRequired, selectJsonSchemaDialectDefault: PropTypes.func.isRequired, }).isRequired, } export default JsonSchemaDialect