@@ -23,7 +23,10 @@ export const SchemaRow: React.FunctionComponent<ISchemaRow> = ({ className, node
2323 throw new Error ( 'Missing metadata' ) ;
2424 }
2525
26- const schemaNode = metadata . schema ;
26+ const { path, schema : schemaNode } = metadata ;
27+
28+ const parentSchemaNode =
29+ node . parent === null || ! ( node . parent . id in MetadataStore ) ? null : MetadataStore [ node . parent . id ] . schema ;
2730 const description = 'annotations' in schemaNode ? schemaNode . annotations . description : null ;
2831
2932 return (
@@ -46,16 +49,24 @@ export const SchemaRow: React.FunctionComponent<ISchemaRow> = ({ className, node
4649 />
4750 ) }
4851
49- { 'combiner' in schemaNode && < Divider kind = { schemaNode . combiner } /> }
52+ { node . parent !== null &&
53+ node . parent . children . length > 0 &&
54+ parentSchemaNode !== null &&
55+ 'combiner' in parentSchemaNode &&
56+ node . parent . children [ 0 ] !== node && < Divider kind = { parentSchemaNode . combiner } /> }
5057
5158 < div className = "flex-1 flex truncate" >
5259 < Property node = { schemaNode } path = { metadata . path } onGoToRef = { onGoToRef } />
5360 { description && < Description value = { description } /> }
5461 </ div >
5562
5663 < Validations
57- required = { /* todo: implement me */ false }
58- // required={!!schemaNode.required}
64+ required = {
65+ parentSchemaNode !== null &&
66+ 'required' in parentSchemaNode &&
67+ Array . isArray ( parentSchemaNode . required ) &&
68+ parentSchemaNode . required . includes ( String ( path [ path . length - 1 ] ) )
69+ }
5970 validations = { {
6071 ...( 'annotations' in schemaNode &&
6172 schemaNode . annotations . default && { default : schemaNode . annotations . default } ) ,
0 commit comments