File tree Expand file tree Collapse file tree 2 files changed +18
-9
lines changed Expand file tree Collapse file tree 2 files changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -93,14 +93,23 @@ function normalizeInputSchema(schemaLike: unknown): JSONSchema {
9393function getCellSchema (
9494 cell : Cell < unknown > ,
9595) : JSONSchema | undefined {
96- return cell . schema ??
97- // If cell has a source cell, any resultRef has a schema attached
98- cell . getSourceCell < { resultRef : Cell < unknown > } > ( {
99- type : "object" ,
100- properties : { resultRef : { asCell : true } } ,
101- } ) ?. get ( ) ?. resultRef ?. schema ??
102- // Otherwise, derive a simple object schema from the current value
103- buildMinimalSchemaFromValue ( cell ) ;
96+ if ( cell . schema ) return cell . schema ;
97+
98+ const sourceCell = cell . getSourceCell < { resultRef : Cell < unknown > } > ( {
99+ type : "object" ,
100+ properties : { resultRef : { asCell : true } } ,
101+ } ) ;
102+ const sourceCellSchema = sourceCell ?. key ( "resultRef" ) . get ( ) ?. schema ;
103+ if ( sourceCellSchema !== undefined ) {
104+ const cfc = new ContextualFlowControl ( ) ;
105+ return cfc . schemaAtPath (
106+ sourceCellSchema ,
107+ cell . getAsNormalizedFullLink ( ) . path ,
108+ cell . schema ,
109+ ) ;
110+ }
111+
112+ return buildMinimalSchemaFromValue ( cell ) ;
104113}
105114
106115function buildMinimalSchemaFromValue ( charm : Cell < any > ) : JSONSchema | undefined {
Original file line number Diff line number Diff line change @@ -505,7 +505,7 @@ export class ContextualFlowControl {
505505 */
506506 schemaAtPath (
507507 schema : JSONSchema ,
508- path : string [ ] ,
508+ path : readonly string [ ] ,
509509 rootSchema ?: JSONSchema ,
510510 extraClassifications ?: Set < string > ,
511511 ) : JSONSchema {
You can’t perform that action at this time.
0 commit comments