Display object model extensions correctly
This commit is contained in:
@@ -26,6 +26,8 @@ export default class ObjectModel extends Component {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const { showExtensions } = getConfigs()
|
||||||
|
|
||||||
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")
|
||||||
@@ -99,6 +101,30 @@ export default class ObjectModel extends Component {
|
|||||||
</tr>)
|
</tr>)
|
||||||
}).toArray()
|
}).toArray()
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
// empty row befor extensions...
|
||||||
|
!showExtensions ? null : <tr> </tr>
|
||||||
|
}
|
||||||
|
{
|
||||||
|
!showExtensions ? null :
|
||||||
|
schema.entrySeq().map(
|
||||||
|
([key, value]) => {
|
||||||
|
if(key.slice(0,2) !== "x-") {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
const normalizedValue = !value ? null : value.toJS ? value.toJS() : value
|
||||||
|
|
||||||
|
return (<tr key={key} style={{ color: "#777" }}>
|
||||||
|
<td>
|
||||||
|
{ key }
|
||||||
|
</td>
|
||||||
|
<td style={{ verticalAlign: "top" }}>
|
||||||
|
{ JSON.stringify(normalizedValue) }
|
||||||
|
</td>
|
||||||
|
</tr>)
|
||||||
|
}).toArray()
|
||||||
|
}
|
||||||
{
|
{
|
||||||
!additionalProperties || !additionalProperties.size ? null
|
!additionalProperties || !additionalProperties.size ? null
|
||||||
: <tr>
|
: <tr>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ table
|
|||||||
|
|
||||||
&:first-of-type
|
&:first-of-type
|
||||||
{
|
{
|
||||||
width: 124px;
|
width: 174px;
|
||||||
padding: 0 0 0 2em;
|
padding: 0 0 0 2em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user