diff --git a/lib/generator.js b/lib/generator.js index 92f835945..95bfc9c99 100644 --- a/lib/generator.js +++ b/lib/generator.js @@ -98,7 +98,7 @@ class Generator { const options = arguments[arguments.length - 1]; const invalidOptions = getInvalidOptions(GENERATOR_OPTIONS, options || []); if (invalidOptions.length) throw new Error(`These options are not supported by the generator: ${invalidOptions.join(', ')}`); - if (options && options.registry) { + if (options && this.verifyRegistryOption(options.registry)) { const invalidRegOptions = getInvalidOptions(REGISTRY_OPTIONS, options.registry || []); this.isInvalidRegOptions(invalidRegOptions); } @@ -161,6 +161,18 @@ class Generator { isInvalidRegOptions(invalidRegOptions) { if (invalidRegOptions.length) throw new Error(`These options are not supported by the generator to configure private registry: ${invalidRegOptions.join(', ')}`); } + + /** + * Check if the Registry Options is present or not. + * + * @private + * @param {Object} registryOption Registry Options. + * @return {boolean} + */ + + verifyRegistryOption(registryOption) { + return registryOption === null; + } /** * Generates files from a given template and an AsyncAPIDocument object.