diff --git a/scripts/fixSchemas.ts b/scripts/fixSchemas.ts index 0a38b95193..da24819b00 100644 --- a/scripts/fixSchemas.ts +++ b/scripts/fixSchemas.ts @@ -208,13 +208,27 @@ function extractHintsFrom( validators: Validators, Constants: Constants, }) - if (hints["suggestions"]?.indexOf(null) >= 0) { + const evaluatedSuggestions = hints["suggestions"] + + if (evaluatedSuggestions?.indexOf(null) >= 0) { throw ( "A suggestion generated 'null' for " + path.join(".") + ". Check the docstring, specifically 'suggestions'. Pay attention to double commas" ) } + + console.log(evaluatedSuggestions) + for (const hintElement of evaluatedSuggestions ?? []) { + if (typeof hintElement === "string") { + throw ( + "A suggestion generated a string for " + + path.join(".") + + ". Remember that you should use {'if': 'value=[actual_value]', 'then': '[some explanation]'}" + ) + } + } + } return hints } diff --git a/src/Models/ThemeConfig/Json/PointRenderingConfigJson.ts b/src/Models/ThemeConfig/Json/PointRenderingConfigJson.ts index 723aac46e5..f9c0d1c7e4 100644 --- a/src/Models/ThemeConfig/Json/PointRenderingConfigJson.ts +++ b/src/Models/ThemeConfig/Json/PointRenderingConfigJson.ts @@ -13,14 +13,15 @@ export interface IconConfigJson { * * * types: Use a different icon depending on the value of some attributes ; icon - * suggestions: return [ "nsi_brand.icon", "nsi_operator.icon", "id_presets.shop_rendering", ...Constants.defaultPinIcons.map(i => ({if: "value="+i, then: i, icon: i}))] + * suggestions: return [ {"if":"value=nsi_brand.icon", "then": "Use icons for brand from the Name Suggestion Index"}, {"if":"value=nsi_operator.icon", "then": "Use icons for operator from the Name Suggestion Index"}, {"if":"value=id_presets.shop_rendering", "then": "Use shop preset icons from iD"}, ...Constants.defaultPinIcons.map(i => ({if: "value="+i, then: i, icon: i}))] */ icon: string | MinimalTagRenderingConfigJson | { builtin: string; override: any } /** * question: What colour should the icon be? - * This will only work for the default icons such as `pin`,`circle`,... - * types: Use a different color depending on the value of some attributes ; color * + * This will only work for the default icons such as `pin`,`circle`,... + * + * types: Use a different color depending on the value of some attributes ; color */ color?: string | MinimalTagRenderingConfigJson | { builtin: string; override: any } }