@@ -53,7 +53,7 @@ export interface IExtractorConfigParseConfigObjectOptions {
5353 /**
5454 * An already prepared configuration object as returned by {@link ExtractorConfig.loadJsonFileWithInheritance}.
5555 */
56- configObject : Partial < IExtractorConfig > ;
56+ configObject : IExtractorConfig ;
5757
5858 /**
5959 * The absolute path of the file that the `configObject` object was loaded from. This is used for error messages
@@ -232,7 +232,7 @@ export class ExtractorConfig {
232232 */
233233 public static loadAndParseConfig ( configJsonFilePath : string ) : ExtractorConfig {
234234 const configObjectFullPath : string = path . resolve ( configJsonFilePath ) ;
235- const configObject : Partial < IExtractorConfig > = ExtractorConfig . loadJsonFileWithInheritance ( configObjectFullPath ) ;
235+ const configObject : IExtractorConfig = ExtractorConfig . loadJsonFileWithInheritance ( configObjectFullPath ) ;
236236
237237 const packageJsonLookup : PackageJsonLookup = new PackageJsonLookup ( ) ;
238238 const packageJsonFullPath : string | undefined = packageJsonLookup . tryGetPackageJsonFilePathFor (
@@ -257,7 +257,7 @@ export class ExtractorConfig {
257257 * If the "extends" field is present, the referenced file(s) will be merged,
258258 * along with the API Extractor defaults.
259259 */
260- public static loadJsonFileWithInheritance ( jsonFilePath : string ) : Partial < IExtractorConfig > {
260+ public static loadJsonFileWithInheritance ( jsonFilePath : string ) : IExtractorConfig {
261261 // Set to keep track of config files which have been processed.
262262 const visitedPaths : Set < string > = new Set < string > ( ) ;
263263
@@ -310,7 +310,10 @@ export class ExtractorConfig {
310310 // Lastly, apply the defaults
311311 configObject = lodash . merge ( lodash . cloneDeep ( ExtractorConfig . _defaultConfig ) , configObject ) ;
312312
313- return configObject ;
313+ ExtractorConfig . jsonSchema . validateObject ( configObject , jsonFilePath ) ;
314+
315+ // The schema validation should ensure that this object conforms to IExtractorConfig
316+ return configObject as IExtractorConfig ;
314317 }
315318
316319 /**
0 commit comments