File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -719,17 +719,28 @@ impl GeneratedSbom {
719719 }
720720 }
721721
722+ use cyclonedx_bom:: models:: bom:: SpecVersion :: * ;
723+ let spec_version = config. spec_version . unwrap_or ( V1_3 ) ;
724+
722725 log:: info!( "Outputting {}" , path. display( ) ) ;
723726 let file = File :: create ( path) ?;
724727 let mut writer = BufWriter :: new ( file) ;
725728 match config. format ( ) {
726729 Format :: Json => {
727- bom. output_as_json_v1_3 ( & mut writer)
728- . map_err ( SbomWriterError :: JsonWriteError ) ?;
730+ match spec_version {
731+ V1_3 => bom. output_as_json_v1_3 ( & mut writer) ,
732+ V1_4 => bom. output_as_json_v1_4 ( & mut writer) ,
733+ _ => unimplemented ! ( ) ,
734+ }
735+ . map_err ( SbomWriterError :: JsonWriteError ) ?;
729736 }
730737 Format :: Xml => {
731- bom. output_as_xml_v1_3 ( & mut writer)
732- . map_err ( SbomWriterError :: XmlWriteError ) ?;
738+ match spec_version {
739+ V1_3 => bom. output_as_xml_v1_3 ( & mut writer) ,
740+ V1_4 => bom. output_as_xml_v1_4 ( & mut writer) ,
741+ _ => unimplemented ! ( ) ,
742+ }
743+ . map_err ( SbomWriterError :: XmlWriteError ) ?;
733744 }
734745 }
735746
You can’t perform that action at this time.
0 commit comments