-
-
Notifications
You must be signed in to change notification settings - Fork 748
Description
- I have checked issues with bug label and found no duplicates
Expected Behavior
When adding a declaration option for a plugin the following call should work:
typedoc.options.addDeclaration({
type: ParameterType.Map,
name: "fontStyle",
map: new Map([
["normal", FontStyle.Normal],
["plain", FontStyle.Plain],
["italic", FontStyle.Italic],
["bold", FontStyle.Bold],
],
defaultValue: FontStyle.Undefined,
});
A default value not listed in the map of possible values enables the plugin to verify whether or not a value was provided for the option at all. Otherwise the plugin can't know if the default value was a fallback or specified by the user. This might make a difference in the logic of the plugin.
Actual Behavior
Upon loading the plugin the following error is thrown:
Error: Failed to validate default value for fontStyle
at Result.expect (C:\MyProjects\typedoc\class-proj\node_modules\typedoc\dist\lib\utils\result.js:17:15)
at Options.addDeclaration (C:\MyProjects\typedoc\class-proj\node_modules\typedoc\dist\lib\utils\options\options.js:59:18)
at PluginEnumOption.addToApplication (C:\MyProjects\typedoc\class-proj\node_modules\typedoc-plugin-base\dist\plugin_enum_option.js:43:25)
at PlantUmlPluginOptions.addToApplication (C:\MyProjects\typedoc\class-proj\node_modules\typedoc-plantuml\dist\plantuml_plugin_options.js:138:51)
at PlantUmlPlugin.addOptionsToApplication (C:\MyProjects\typedoc\class-proj\node_modules\typedoc-plantuml\dist\plantuml_plugin.js:62:22)
at PlantUmlPlugin.PluginBase.initialize (C:\MyProjects\typedoc\class-proj\node_modules\typedoc-plugin-base\dist\plugin_base.js:14:14)
at load (C:\MyProjects\typedoc\class-proj\node_modules\typedoc-plantuml\dist\index.js:9:44)
at PluginHost.load (C:\MyProjects\typedoc\class-proj\node_modules\typedoc\dist\lib\utils\plugins.js:28:21)
at CliApplication.bootstrap (C:\MyProjects\typedoc\class-proj\node_modules\typedoc\dist\lib\application.js:44:22)
at CliApplication.bootstrap (C:\MyProjects\typedoc\class-proj\node_modules\typedoc\dist\lib\cli.js:29:30)
C:\MyProjects\typedoc\class-proj\node_modules\typedoc\dist\lib\utils\result.js:17
throw new Error(message);
Steps to reproduce the bug
The code is part of my custom plugin. You can find it here: https://github.com/krisztianb/typedoc-plantuml
Environment
- Typedoc version: 0.17.3
- Node.js version: 12.13.0
- OS: Windows 10
Metadata
Metadata
Assignees
Labels
No labels