Skip to content

Commit 01d84cd

Browse files
authored
Merge pull request #3941 from shockey/bug/3932-schema-not-values
Don't treat `not` as an array (in contrast to `allOf`, `anyOf`, `oneOf`)
2 parents cfc7b1a + 9f18e02 commit 01d84cd

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

src/core/components/model.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import React, { PureComponent } from "react"
2+
import ImPropTypes from "react-immutable-proptypes"
23
import PropTypes from "prop-types"
34

45
export default class Model extends PureComponent {
56
static propTypes = {
6-
schema: PropTypes.object.isRequired,
7+
schema: ImPropTypes.orderedMap.isRequired,
78
getComponent: PropTypes.func.isRequired,
89
specSelectors: PropTypes.object.isRequired,
910
name: PropTypes.string,

src/core/components/object-model.jsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,13 @@ export default class ObjectModel extends Component {
142142
: <tr>
143143
<td>{ "not ->" }</td>
144144
<td>
145-
{not.map((schema, k) => {
146-
return <div key={k}><Model { ...otherProps } required={ false }
147-
getComponent={ getComponent }
148-
schema={ schema }
149-
depth={ depth + 1 } /></div>
150-
})}
145+
<div>
146+
<Model { ...otherProps }
147+
required={ false }
148+
getComponent={ getComponent }
149+
schema={ not }
150+
depth={ depth + 1 } />
151+
</div>
151152
</td>
152153
</tr>
153154
}

0 commit comments

Comments
 (0)