From fd6a9790f77187a1d06ed4dd81b493f4570ab927 Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Tue, 13 Feb 2024 17:14:04 -0500 Subject: [PATCH] json schema: use description VSCode uses "description" to show documentation and not "documentation". This seems to be the correct convention, see https://json-schema.org/learn/miscellaneous-examples for example. --- source/world_builder/types/array.cc | 2 +- source/world_builder/types/bool.cc | 2 +- source/world_builder/types/double.cc | 2 +- source/world_builder/types/object.cc | 2 +- source/world_builder/types/one_of.cc | 2 +- source/world_builder/types/plugin_system.cc | 2 +- source/world_builder/types/point.cc | 2 +- source/world_builder/types/segment.cc | 2 +- source/world_builder/types/string.cc | 2 +- source/world_builder/types/unsigned_int.cc | 2 +- source/world_builder/types/value_at_points.cc | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/source/world_builder/types/array.cc b/source/world_builder/types/array.cc index 7628b0ab1..11106abb8 100644 --- a/source/world_builder/types/array.cc +++ b/source/world_builder/types/array.cc @@ -68,7 +68,7 @@ namespace WorldBuilder Pointer((base + "/minItems").c_str()).Set(declarations,min_items); Pointer((base + "/maxItems").c_str()).Set(declarations,max_items); Pointer((base + "/uniqueItems").c_str()).Set(declarations,unique_items); - Pointer((base + "/documentation").c_str()).Set(declarations,documentation.c_str()); + Pointer((base + "/description").c_str()).Set(declarations,documentation.c_str()); prm.enter_subsection(name); { diff --git a/source/world_builder/types/bool.cc b/source/world_builder/types/bool.cc index af57f5d0e..f07e1bee9 100644 --- a/source/world_builder/types/bool.cc +++ b/source/world_builder/types/bool.cc @@ -55,7 +55,7 @@ namespace WorldBuilder Pointer((base + "/default value").c_str()).Set(declarations,default_value); Pointer((base + "/type").c_str()).Set(declarations,"boolean"); - Pointer((base + "/documentation").c_str()).Set(declarations,documentation.c_str()); + Pointer((base + "/description").c_str()).Set(declarations,documentation.c_str()); } } // namespace Types } // namespace WorldBuilder diff --git a/source/world_builder/types/double.cc b/source/world_builder/types/double.cc index a4a37bdce..cde120146 100644 --- a/source/world_builder/types/double.cc +++ b/source/world_builder/types/double.cc @@ -56,7 +56,7 @@ namespace WorldBuilder Pointer((base + "/default value").c_str()).Set(declarations,default_value); Pointer((base + "/type").c_str()).Set(declarations,"number"); - Pointer((base + "/documentation").c_str()).Set(declarations,documentation.c_str()); + Pointer((base + "/description").c_str()).Set(declarations,documentation.c_str()); } } // namespace Types } // namespace WorldBuilder diff --git a/source/world_builder/types/object.cc b/source/world_builder/types/object.cc index 037b00f88..314018dd4 100644 --- a/source/world_builder/types/object.cc +++ b/source/world_builder/types/object.cc @@ -63,7 +63,7 @@ namespace WorldBuilder const std::string path = prm.get_full_json_path(); Pointer((path + "/type").c_str()).Set(declarations,"object"); - Pointer((path + "/documentation").c_str()).Set(declarations,documentation.c_str()); + Pointer((path + "/description").c_str()).Set(declarations,documentation.c_str()); Pointer((path + "/additionalProperties").c_str()).Set(declarations,additional_properties); if (!required.empty()) diff --git a/source/world_builder/types/one_of.cc b/source/world_builder/types/one_of.cc index 041e25dfc..651258efc 100644 --- a/source/world_builder/types/one_of.cc +++ b/source/world_builder/types/one_of.cc @@ -57,7 +57,7 @@ namespace WorldBuilder prm.enter_subsection(name); { - Pointer((base + "/documentation").c_str()).Set(declarations,documentation.c_str()); + Pointer((base + "/description").c_str()).Set(declarations,documentation.c_str()); prm.enter_subsection("oneOf"); { for (size_t i = 0; i < inner_types_ptr.size(); i++) diff --git a/source/world_builder/types/plugin_system.cc b/source/world_builder/types/plugin_system.cc index 76acfe136..f710c305f 100644 --- a/source/world_builder/types/plugin_system.cc +++ b/source/world_builder/types/plugin_system.cc @@ -63,7 +63,7 @@ namespace WorldBuilder prm.enter_subsection(name); { const std::string path = prm.get_full_json_path(); - Pointer((path + "/documentation").c_str()).Set(prm.declarations,documentation.c_str()); + Pointer((path + "/description").c_str()).Set(prm.declarations,documentation.c_str()); Pointer((path + "/default value").c_str()).Set(prm.declarations,default_value.c_str()); if (allow_multiple) diff --git a/source/world_builder/types/point.cc b/source/world_builder/types/point.cc index c512cd400..db1c39b1c 100644 --- a/source/world_builder/types/point.cc +++ b/source/world_builder/types/point.cc @@ -86,7 +86,7 @@ namespace WorldBuilder Pointer((base + "/type").c_str()).Set(declarations,"array"); Pointer((base + "/minItems").c_str()).Set(declarations,dim); Pointer((base + "/maxItems").c_str()).Set(declarations,dim); - Pointer((base + "/documentation").c_str()).Set(declarations,documentation.c_str()); + Pointer((base + "/description").c_str()).Set(declarations,documentation.c_str()); Pointer((base + "/items/type").c_str()).Set(declarations,"number"); // todo: default value } diff --git a/source/world_builder/types/segment.cc b/source/world_builder/types/segment.cc index fb2d7d00f..554e7c62c 100644 --- a/source/world_builder/types/segment.cc +++ b/source/world_builder/types/segment.cc @@ -117,7 +117,7 @@ namespace WorldBuilder Pointer((base + "/type").c_str()).Set(declarations,"object"); Pointer((base + "/additionalProperties").c_str()).Set(declarations,false); - Pointer((base + "/documentation").c_str()).Set(declarations,documentation.c_str()); + Pointer((base + "/description").c_str()).Set(declarations,documentation.c_str()); std::vector restricted_values = {"length", "thickness", "angle"}; for (unsigned int i = 0; i < restricted_values.size(); ++i) { diff --git a/source/world_builder/types/string.cc b/source/world_builder/types/string.cc index 8c1ca1d9c..88373ef72 100644 --- a/source/world_builder/types/string.cc +++ b/source/world_builder/types/string.cc @@ -95,7 +95,7 @@ namespace WorldBuilder const std::string base = prm.get_full_json_path() + "/" + name; Pointer((base + "/default value").c_str()).Set(declarations,default_value.c_str()); Pointer((base + "/type").c_str()).Set(declarations,"string"); - Pointer((base + "/documentation").c_str()).Set(declarations,documentation.c_str()); + Pointer((base + "/description").c_str()).Set(declarations,documentation.c_str()); for (unsigned int i = 0; i < restricted_values.size(); ++i) { if (!restricted_values[i].empty()) diff --git a/source/world_builder/types/unsigned_int.cc b/source/world_builder/types/unsigned_int.cc index 592647ab3..90d491f6d 100644 --- a/source/world_builder/types/unsigned_int.cc +++ b/source/world_builder/types/unsigned_int.cc @@ -56,7 +56,7 @@ namespace WorldBuilder const std::string base = prm.get_full_json_path() + "/" + name; Pointer((base + "/default value").c_str()).Set(declarations,default_value); Pointer((base + "/type").c_str()).Set(declarations,"integer"); - Pointer((base + "/documentation").c_str()).Set(declarations,documentation.c_str()); + Pointer((base + "/description").c_str()).Set(declarations,documentation.c_str()); } } // namespace Types diff --git a/source/world_builder/types/value_at_points.cc b/source/world_builder/types/value_at_points.cc index a3a2eacd5..d36b5375a 100644 --- a/source/world_builder/types/value_at_points.cc +++ b/source/world_builder/types/value_at_points.cc @@ -68,7 +68,7 @@ namespace WorldBuilder Pointer((base + "/additionalProperties").c_str()).Set(declarations,false); Pointer((base + "/minItems").c_str()).Set(declarations,1); Pointer((base + "/maxItems").c_str()).Set(declarations,2); - Pointer((base + "/documentation").c_str()).Set(declarations,documentation.c_str()); + Pointer((base + "/description").c_str()).Set(declarations,documentation.c_str()); { Pointer((base + "/items/anyOf/0/type").c_str()).Set(declarations,"number");