File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -302,6 +302,20 @@ export const relationshipSchema = attackBaseRelationshipObjectSchema
302302 . strict ( )
303303 . check ( ( ctx ) => {
304304 createRelationshipValidationRefinement ( ) ( ctx ) ;
305+ } )
306+ . transform ( ( data ) => {
307+ // Check for deprecated pattern
308+ const [ sourceType ] = data . source_ref . split ( '--' ) as [ StixType ] ;
309+ if (
310+ sourceType === 'x-mitre-data-component' &&
311+ data . relationship_type === 'detects' &&
312+ data . target_ref . startsWith ( 'attack-pattern--' )
313+ ) {
314+ console . warn (
315+ 'DEPRECATION WARNING: x-mitre-data-component -> detects -> attack-pattern relationships are deprecated' ,
316+ ) ;
317+ }
318+ return data ;
305319 } ) ;
306320
307321export type Relationship = z . infer < typeof relationshipSchema > ;
You can’t perform that action at this time.
0 commit comments