Skip to content

Commit

Permalink
Update OpenAPI schemas and descriptions for visualization functions
Browse files Browse the repository at this point in the history
  • Loading branch information
riccardodebenedictis committed May 8, 2024
1 parent cc7e8d1 commit e9f0d22
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/solver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ namespace ratio
const json::json object_value_schema{{"object_value", {{"type", "object"}, {"properties", {{"type", {{"type", "string"}, {"enum", {"object"}}}}, {"val", {{"type", "integer"}}}}}, {"required", json::to_array({"type", "val"})}}}};
const json::json item_schema{{"item", {{"type", "object"}, {"properties", {{"id", {{"type", "integer"}}}, {"type", {{"type", "string"}}}, {"name", {{"type", "string"}}}, {"exprs", {{"type", "object"}, {"additionalProperties", {{"$ref", "#/components/schemas/value"}}}}}}}, {"required", {"id", "type", "name"}}}}};
const json::json atom_schema{{"atom", {{"type", "object"}, {"properties", {{"id", {{"type", "integer"}}}, {"is_fact", {{"type", "boolean"}}}, {"sigma", {{"type", "integer"}}}, {"type", {{"type", "string"}}}, {"status", {{"type", "string"}, {"enum", {"Active", "Inactive", "Unified"}}}}, {"name", {{"type", "string"}}}, {"exprs", {{"type", "object"}, {"additionalProperties", {{"$ref", "#/components/schemas/value"}}}}}}}, {"required", {"id", "type", "name"}}}}};
const json::json solver_state_schema{{"solver_state", {{"type", "object"}, {"properties", {{"name", {{"type", "string"}}}, {"items", {{"type", "array"}, {"items", {{"$ref", "#/components/schemas/item"}}}}}, {"atoms", {{"type", "array"}, {"items", {{"$ref", "#/components/schemas/atom"}}}}}, {"exprs", {{"type", "object"}, {"additionalProperties", {{"$ref", "#/components/schemas/value"}}}}}}}, {"required", {"name"}}}}};
const json::json solver_timeline_schema{{"solver_timeline", {{"type", "object"}, {"properties", {{"id", {{"type", "integer"}}}, {"type", {{"type", "string"}, {"enum", {"Solver"}}}}, {"name", {{"type", "string"}}}, {"values", {{"type", "array"}, {"items", {{"type", "integer"}}}}}}}, {"required", {"id", "type", "name"}}}}};
#endif

Expand Down
2 changes: 1 addition & 1 deletion include/types/agent.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ namespace ratio
};

#ifdef ENABLE_VISUALIZATION
const json::json agent_timeline_schema{{"agent_timeline", {{"type", "object"}, {"properties", {{"id", {{"type", "integer"}}}, {"type", {{"type", "string"}, {"enum", {"Agent"}}}}, {"name", {{"type", "string"}}}, {"values", {{"type", "array"}, {"items", {{"type", "integer"}}}}}}}, {"required", {"id", "type", "name"}}}}};
const json::json agent_timeline_schema{{"agent_timeline", {{"type", "object"}, {"description", "Schema representing an agent timeline"}, {"properties", {{"id", {{"type", "integer"}, {"description", "The ID of the agent"}}}, {"type", {{"type", "string"}, {"enum", {"Agent"}}}}, {"name", {{"type", "string"}, {"description", "The name of the agent"}}}, {"values", {{"type", "array"}, {"items", {{"type", "integer"}}}, {"description", "Array of item IDs"}}}}}, {"required", {"id", "type", "name"}}}}};
#endif
} // namespace ratio

0 comments on commit e9f0d22

Please sign in to comment.