Add comment to array-model for to clarify change. Rework logic in Model.render() to fix bug with overriding name and schema from $ref definition.

This commit is contained in:
Owen Conti
2017-09-09 13:51:09 -06:00
parent e9f46e6f5e
commit 12c96e3190
2 changed files with 30 additions and 77 deletions

View File

@@ -28,10 +28,15 @@ export default class ArrayModel extends Component {
<span className="model-title__text">{ title }</span>
</span>
/*
Note: we set `name={null}` in <Model> below because we don't want
the name of the current Model passed (and displayed) as the name of the array element Model
*/
return <span className="model">
<ModelCollapse title={titleEl} collapsed={ depth > expandDepth } collapsedContent="[...]">
[
<span><Model { ...this.props } schema={ items } required={ false } depth={ depth + 1 } /></span>
<span><Model { ...this.props } name={null} schema={ items } required={ false } depth={ depth + 1 } /></span>
]
{
properties.size ? <span>