Migrating to the version 4 API from the version 3 API

May 12, 2025 ยท View on GitHub

This release includes breaking changes to the API. Most API consumers will be impacted by the casing changes. Only a few customers are likely to be impacted by the functional changes.

Casing changes

The cases used in the 3.0 API were very inconsistent. The interfaces and classes that were written very early tended to spell "sbom" as "SBOM" (all caps), while code added later tended to use "Sbom" (Pascal case). Casing of the file names were similarly inconsistent. We decided to take this opportunity to adopt "Sbom" as our standard within the code (this matches the namespace), but still retain "SBOM" as the standalone form in documentation and comments. We haven't yet updated all of the test classes, but that should be a non-issue to users of the API. The "quick and dirty" change in your code is to do a case-sensitive global replacement of "SBOM" with "Sbom". The following table describes the detailed casing changes--this list is intended to be exhaustive and includes interfaces and classes that very few people would ever need to worry about:

Interfaces

Old name (all caps)New name (Pascal case)
ISBOMGeneratorISbomGenerator
ISBOMReaderForExternalDocumentReferenceISbomReaderForExternalDocumentReference
ISBOMValidatorISbomValidator
IValidatedSBOMIValidatedSbom

Classes

Old name (all caps)New name (Pascal case)
ComponentDetectionToSBOMPackageAdapterComponentDetectionToSbomPackageAdapter
InternalSBOMFileInfoDeduplicatorInternalSbomFileInfoDeduplicator
SBOMApiMetadataProviderSbomApiMetadataProvider
SBOMComponentsWalkerSbomComponentsWalker
SBOMFileSbomFile
SBOMFormatExtensionsSbomFormatExtensions
SBOMMetadataSbomMetadata
SBOMPackagesProviderSbomPackagesProvider
SBOMReferenceSbomReference
SBOMRelationshipSbomRelationship
SBOMTelemetrySbomTelemetry
SBOMValidationResultSbomValidationResult
SPDXSBOMReaderForExternalDocumentReferenceSPDXSbomReaderForExternalDocumentReference
ValidatedSBOMValidatedSbom
ValidatedSBOMFactoryValidatedSbomFactory

Methods

Old name (all caps)New name (Pascal case)
IInternalMetadataProvider.GetSBOMNamespaceUriIInternalMetadataProvider.GetSbomNamespaceUri
IRecorder.RecordSBOMFormatIRecorder.RecordSbomFormat
ISBOMGenerator.GetSupportedSBOMSpecificationsISbomGenerator.GetSupportedSbomSpecifications
ISBOMReaderForExternalDocumentReference.ParseSBOMFileISbomReaderForExternalDocumentReference.ParseSbomFile
ISbomRedactor.RedactSBOMAsyncISbomRedactor.RedactSbomAsync
ManifestInfo.ToSBOMSpecificationManifestInfo.ToSbomSpecification
SbomConfigProvider.GetSBOMNamespaceUriSbomConfigProvider.GetSbomNamespaceUri
SbomGenerator.GetSupportedSBOMSpecificationsSbomGenerator.GetSupportedSbomSpecifications
SbomRedactor.RedactSBOMAsyncSbomRedactor.RedactSbomAsync
SPDXSBOMReaderForExternalDocumentReference.ParseSBOMFileSPDXSbomReaderForExternalDocumentReference.ParseSbomFile
TelemetryRecorder.RecordSBOMFormatTelemetryRecorder.RecordSbomFormat
ValidatedSBOMFactory.CreateValidatedSBOMValidatedSbomFactory.CreateValidatedSbom

Properties and const values

Old name (all caps)New name (Pascal case)
Events.SBOMGenerationWorkflowEvents.SbomGenerationWorkflow
Events.SBOMParseMetadataEvents.SbomParseMetadata
Events.SBOMValidationWorkflowEvents.SbomValidationWorkflow
FileHashes.SBOMFileHashFileHashes.SbomFileHash
IAssemblyConfig.DefaultSBOMNamespaceBaseUriIAssemblyConfig.DefaultSbomNamespaceBaseUri
MetadataKey.SBOMToolNameMetadataKey.SbomToolName
MetadataKey.SBOMToolVersionMetadataKey.SbomToolVersion
SettingsSource.SBOMApiSettingsSource.SbomApi

We discussed making a similar change with "SPDX", but ultimately decided to leave "SPDX" as all caps when dealing with interfaces and classes. There are many places in the code where variables use either camel casing or Pascal casing, but none of those should impact code that builds upon our API.

Functional changes

If you use the Workflows that are documented here, then you will not be impacted by most of the functional changes. You will get the default implementations of the classes, which implement the current API. If, however, you create your own implementations or wrappers based on any of the interfaces exposed in our API, then you may need to make corresponding changes in your code. This table summarizes the changes:

ScopeType of changeDetail
ILicenseInformationFetcher.FetchLicenseInformationAsyncNew parameterint timeoutInSeconds
ILicenseInformationFetcher.AppendLicensesToDictionaryGeneric TypeIDictionary instead of Dictionary for partialLicenseDictionary
ILicenseInformationFetcher.ConvertClearlyDefinedApiResposeToListGeneric TypeReturns IDictionary instead of Dictionary
ILicenseInformationFetcher.ConvertComponentsToListForApiGeneric TypeReturns IList instead of List
ILicenseInformationFetcher.FetchLicenseInformationAsyncGeneric TypeReturns IList instead of List
ILicenseInformationService.FetchLicenseInformationFromAPINew parameterint timeoutInSeconds
ILicenseInformationService.FetchLicenseInformationFromAPIGeneric TypeIList instead of List for listofComponetsForApi
ILicenseInformationService.FetchLicenseInformationFromAPIGeneric TypeReturns IList instead of List
IRecorderNew methodvoid AddResult(string propertyName, string propertyValue)
IAssemblyConfigNew propertyManifestInfo DefaultManifestInfoForGenerationAction
IJsonArrayGenerator.GenerateAsyncGeneric TypeIList instead of List for listOfComponenentsForApi
IJsonArrayGenerator.GenerateAsyncGeneric TypeReturns IList instead of List
IMetadataBuilderNew methodTryGetCreationInfoJson(IInternalMetadataProvider internalMetadataProvider, out GeneratorResult generatorResult)
IManifestToolJsonSerializerNew methodvoid Write(JsonElement jsonElement)
ISignedValidator.ValidateNew parameterIDictionary<string, string> additionalTelemetry
ISbomParser.GetMetadata()Return typeSpdxMetadata instead of Spdx22Metadata
ISbomParserNew methodvoid EnforceConformanceStandard(ConformanceStandardType conformanceStandard)
IConfigurationNew propertyConfigurationSetting<ConformanceStandardType> ConformanceStandard
IConfigurationNew propertyConfigurationSetting<int> LicenseInformationTimeoutInSeconds