File tree Expand file tree Collapse file tree
packages/core/src/backend/schema Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -274,6 +274,8 @@ describe("JsonSchemaBackend", () => {
274274 expect ( schema . description ) . toBe ( "Automated brain extraction tool for FSL" ) ;
275275
276276 const props = schema . properties as Record < string , JsonSchema > ;
277+ expect ( props [ "@type" ] ) . toEqual ( { const : "unknown/bet" } ) ;
278+ expect ( schema . required ) . toContain ( "@type" ) ;
277279 expect ( props [ "infile" ] ?. type ) . toBe ( "string" ) ;
278280 expect ( props [ "infile" ] ?. format ) . toBe ( "path" ) ;
279281 expect ( props [ "maskfile" ] ?. type ) . toBe ( "string" ) ;
Original file line number Diff line number Diff line change @@ -27,7 +27,18 @@ class SchemaBuilder {
2727 const rootBinding = this . ctx . resolve ( this . ctx . expr ) ;
2828 if ( ! rootBinding ) return envelope ;
2929
30- return { ...envelope , ...this . fromBinding ( rootBinding ) } ;
30+ const schema = { ...envelope , ...this . fromBinding ( rootBinding ) } ;
31+
32+ if ( this . ctx . app ?. id && schema . properties ) {
33+ const pkg = this . ctx . package ?. name ?? "unknown" ;
34+ schema . properties = {
35+ "@type" : { const : `${ pkg } /${ this . ctx . app . id } ` } ,
36+ ...schema . properties ,
37+ } ;
38+ schema . required = [ "@type" , ...( schema . required ?? [ ] ) ] ;
39+ }
40+
41+ return schema ;
3142 }
3243
3344 private fromBinding ( binding : Binding ) : JsonSchema {
You can’t perform that action at this time.
0 commit comments