diff --git a/src/core/json-schema-components.jsx b/src/core/json-schema-components.jsx index 7d881902ce8..194059ead68 100644 --- a/src/core/json-schema-components.jsx +++ b/src/core/json-schema-components.jsx @@ -129,8 +129,9 @@ export class JsonSchema_array extends PureComponent { } componentWillReceiveProps(props) { - if(props.value !== this.state.value) - this.setState({ value: props.value }) + const value = valueOrEmptyList(props.value) + if(value !== this.state.value) + this.setState({ value }) if(props.schema !== this.state.schema) this.setState({ schema: props.schema }) @@ -151,7 +152,7 @@ export class JsonSchema_array extends PureComponent { value: value.delete(i) }), this.onChange) } - + addItem = () => { let newValue = valueOrEmptyList(this.state.value) this.setState(() => ({ @@ -382,5 +383,5 @@ export class JsonSchema_object extends PureComponent { } function valueOrEmptyList(value) { - return List.isList(value) ? value : List() + return List.isList(value) ? value : Array.isArray(value) ? fromJS(value) : List() } diff --git a/src/core/plugins/oas3/components/request-body.jsx b/src/core/plugins/oas3/components/request-body.jsx index 24dcde3c2fa..42abaa20dff 100644 --- a/src/core/plugins/oas3/components/request-body.jsx +++ b/src/core/plugins/oas3/components/request-body.jsx @@ -133,7 +133,7 @@ const RequestBody = ({
-
- { key }
- { !required ? null : * }
-
-
- { type }
- { format && (${format})}
- {!showCommonExtensions || !commonExt.size ? null : commonExt.entrySeq().map(([key, v]) =>
-
- { prop.get("deprecated") ? "deprecated": null }
-
- |
-
-
- : null }
- |
-
+
+ { key }
+ { !required ? null : * }
+
+
+ { type }
+ { format && (${format})}
+ {!showCommonExtensions || !commonExt.size ? null : commonExt.entrySeq().map(([key, v]) =>
+
+ { prop.get("deprecated") ? "deprecated": null }
+
+ |
+
+
+ : null }
+ |
+
})
}