Skip to content

Commit d306efa

Browse files
committed
engine: Allow $schema key to be present in a cloe stack file
1 parent ec5b8cb commit d306efa

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

engine/src/stack.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -880,6 +880,7 @@ using ConfReader = std::function<Conf(const std::string&)>;
880880
class Stack : public Confable {
881881
private: // Constants (1)
882882
std::vector<std::string> reserved_ids_;
883+
boost::optional<std::string> schema_ref_;
883884

884885
public: // Configuration (13)
885886
EngineConf engine;
@@ -1085,6 +1086,7 @@ class Stack : public Confable {
10851086
using namespace schema; // NOLINT(build/namespaces)
10861087

10871088
return Struct{
1089+
{"$schema", make_schema(&schema_ref_, "valid URI to schema describing this cloe stack version")},
10881090
{"version", make_const_str(CLOE_STACK_VERSION, "version of stackfile").require()},
10891091
{"engine", engine_schema},
10901092
{"include", include_schema},

engine/tests/test_engine_json_schema.json

+11
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
{
22
"additionalProperties": false,
33
"properties": {
4+
"$schema": {
5+
"description": "valid URI to schema describing this cloe stack version",
6+
"oneOf": [
7+
{
8+
"type": "null"
9+
},
10+
{
11+
"type": "string"
12+
}
13+
]
14+
},
415
"controllers": {
516
"description": "controller configuration",
617
"items": {

0 commit comments

Comments
 (0)