Merge branch 'master' into master
This commit is contained in:
@@ -18,7 +18,7 @@ export default class ObjectModel extends Component {
|
|||||||
|
|
||||||
render(){
|
render(){
|
||||||
let { schema, name, isRef, getComponent, depth, ...props } = this.props
|
let { schema, name, isRef, getComponent, depth, ...props } = this.props
|
||||||
let { expandDepth } = this.props
|
let { expandDepth, specSelectors } = this.props
|
||||||
let description = schema.get("description")
|
let description = schema.get("description")
|
||||||
let properties = schema.get("properties")
|
let properties = schema.get("properties")
|
||||||
let additionalProperties = schema.get("additionalProperties")
|
let additionalProperties = schema.get("additionalProperties")
|
||||||
@@ -38,6 +38,10 @@ export default class ObjectModel extends Component {
|
|||||||
}
|
}
|
||||||
</span>)
|
</span>)
|
||||||
|
|
||||||
|
const anyOf = specSelectors.isOAS3() ? schema.get("anyOf") : null
|
||||||
|
const oneOf = specSelectors.isOAS3() ? schema.get("oneOf") : null
|
||||||
|
const not = specSelectors.isOAS3() ? schema.get("not") : null
|
||||||
|
|
||||||
const titleEl = title && <span className="model-title">
|
const titleEl = title && <span className="model-title">
|
||||||
{ isRef && schema.get("$$ref") && <span className="model-hint">{ schema.get("$$ref") }</span> }
|
{ isRef && schema.get("$$ref") && <span className="model-hint">{ schema.get("$$ref") }</span> }
|
||||||
<span className="model-title__text">{ title }</span>
|
<span className="model-title__text">{ title }</span>
|
||||||
@@ -95,6 +99,48 @@ export default class ObjectModel extends Component {
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
!anyOf ? null
|
||||||
|
: <tr>
|
||||||
|
<td>{ "anyOf ->" }</td>
|
||||||
|
<td>
|
||||||
|
{anyOf.map((schema, k) => {
|
||||||
|
return <div key={k}><Model { ...props } required={ false }
|
||||||
|
getComponent={ getComponent }
|
||||||
|
schema={ schema }
|
||||||
|
depth={ depth + 1 } /></div>
|
||||||
|
})}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
{
|
||||||
|
!oneOf ? null
|
||||||
|
: <tr>
|
||||||
|
<td>{ "oneOf ->" }</td>
|
||||||
|
<td>
|
||||||
|
{oneOf.map((schema, k) => {
|
||||||
|
return <div key={k}><Model { ...props } required={ false }
|
||||||
|
getComponent={ getComponent }
|
||||||
|
schema={ schema }
|
||||||
|
depth={ depth + 1 } /></div>
|
||||||
|
})}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
|
{
|
||||||
|
!not ? null
|
||||||
|
: <tr>
|
||||||
|
<td>{ "not ->" }</td>
|
||||||
|
<td>
|
||||||
|
{not.map((schema, k) => {
|
||||||
|
return <div key={k}><Model { ...props } required={ false }
|
||||||
|
getComponent={ getComponent }
|
||||||
|
schema={ schema }
|
||||||
|
depth={ depth + 1 } /></div>
|
||||||
|
})}
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
}
|
||||||
</tbody></table>
|
</tbody></table>
|
||||||
}
|
}
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user