diff --git a/src/components/Fields/FieldDetails.tsx b/src/components/Fields/FieldDetails.tsx index 36a43d3e92..4a7f66d125 100644 --- a/src/components/Fields/FieldDetails.tsx +++ b/src/components/Fields/FieldDetails.tsx @@ -8,7 +8,7 @@ import { TypePrefix, TypeTitle, } from '../../common-elements/fields'; -import { getSerializedValue } from '../../utils'; +import { getSerializedValue, isObject } from '../../utils'; import { ExternalDocumentation } from '../ExternalDocumentation/ExternalDocumentation'; import { Markdown } from '../Markdown/Markdown'; import { EnumValues } from './EnumValues'; @@ -52,6 +52,10 @@ export const FieldDetailsComponent = observer((props: FieldProps) => { return null; }, [field, showExamples]); + const defaultValue = isObject(schema.default) + ? getSerializedValue(field, schema.default).replace(`${field.name}=`, '') + : schema.default; + return (
@@ -92,7 +96,7 @@ export const FieldDetailsComponent = observer((props: FieldProps) => { {l('deprecated')}
)} - + {!renderDiscriminatorSwitch && ( )}{' '}