Skip to content

Commit

Permalink
Merge pull request #560 from tjhei/schema-description
Browse files Browse the repository at this point in the history
json schema: use description
  • Loading branch information
MFraters authored Feb 14, 2024
2 parents 3c5e302 + fd6a979 commit bc9dead
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion source/world_builder/types/array.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
{
Expand Down
2 changes: 1 addition & 1 deletion source/world_builder/types/bool.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion source/world_builder/types/double.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,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
Expand Down
2 changes: 1 addition & 1 deletion source/world_builder/types/object.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion source/world_builder/types/one_of.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
Expand Down
2 changes: 1 addition & 1 deletion source/world_builder/types/plugin_system.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion source/world_builder/types/point.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion source/world_builder/types/segment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::string> restricted_values = {"length", "thickness", "angle"};
for (unsigned int i = 0; i < restricted_values.size(); ++i)
{
Expand Down
2 changes: 1 addition & 1 deletion source/world_builder/types/string.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
2 changes: 1 addition & 1 deletion source/world_builder/types/unsigned_int.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion source/world_builder/types/value_at_points.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit bc9dead

Please sign in to comment.