diff --git a/action/config.go b/action/config.go index 92dd7792..4e5e6331 100644 --- a/action/config.go +++ b/action/config.go @@ -5,13 +5,13 @@ import "encoding/json" // Config is the configuration for the Action type Config struct { //inline action - Ref string `json:"ref"` - Type string `json:"type"` //an alias to the ref, can be used if imported - Settings map[string]interface{} `json:"settings"` + Ref string `json:"ref,omitempty"` + Type string `json:"type,omitempty"` //an alias to the ref, can be used if imported + Settings map[string]interface{} `json:"settings,omitempty"` //referenced action - Id string `json:"id"` + Id string `json:"id,omitempty"` //DEPRECATED - Data json.RawMessage `json:"data"` + Data json.RawMessage `json:"data,omitempty"` } diff --git a/app/config.go b/app/config.go index a766f4f2..00d8f158 100644 --- a/app/config.go +++ b/app/config.go @@ -13,11 +13,12 @@ type Config struct { Type string `json:"type"` Version string `json:"version"` Description string `json:"description"` + AppModel string `json:"appModel"` - Imports []string `json:"imports"` - Properties []*data.Attribute `json:"properties"` - Channels []string `json:"channels"` - Triggers []*trigger.Config `json:"triggers"` - Resources []*resource.Config `json:"resources"` - Actions []*action.Config `json:"actions"` + Imports []string `json:"imports,omitempty"` + Properties []*data.Attribute `json:"properties,omitempty"` + Channels []string `json:"channels,omitempty"` + Triggers []*trigger.Config `json:"triggers,omitempty"` + Resources []*resource.Config `json:"resources,omitempty"` + Actions []*action.Config `json:"actions,omitempty"` } \ No newline at end of file diff --git a/internal/schema/assets.go b/internal/schema/assets.go index abbac7fc..9d98e0c7 100644 --- a/internal/schema/assets.go +++ b/internal/schema/assets.go @@ -68,7 +68,7 @@ func (fi bindataFileInfo) Sys() interface{} { return nil } -var _schemaJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x58\x4d\x8f\xda\x30\x10\xbd\xf3\x2b\xac\x6c\x8f\x5d\xd2\x5b\x25\x6e\xa8\x97\x1e\x7b\xaf\xf6\xe0\x8d\x0d\x78\x05\x4e\x6a\x4f\x2a\xad\x56\xfc\xf7\x8a\x98\x38\x71\xfc\x01\x26\x0e\x9b\x6a\x37\x07\x24\xc6\xce\x78\x66\x3c\x6f\xde\x83\xb7\x05\x42\x08\x65\x5f\x64\xb1\xa3\x07\x9c\xad\x50\xb6\x03\xa8\x56\x79\xfe\x22\x4b\xfe\xa8\xac\xcb\x52\x6c\x73\x22\xf0\x06\x1e\xbf\x7d\xcf\x95\xed\x21\xfb\xaa\xde\x14\xf4\x4f\xcd\x04\x25\xd9\x0a\xfd\x6e\x2c\x8d\x95\xe3\x03\x3d\xef\x68\xbe\xc3\x6b\x65\x7c\xff\x4b\x85\x64\x25\xef\x9b\x08\x95\x85\x60\x15\x0c\xcc\xec\x50\x95\x02\x64\xdf\x54\x89\xb2\xa2\x02\x18\x35\xac\xc5\x0e\x73\x4e\xf7\x86\x0d\x04\xdb\x6e\xa9\x30\x6c\x82\xca\xb2\x16\x85\xf9\x32\x2e\x4e\xe7\xca\xac\xb1\x3c\x9d\x53\xeb\x9d\xb3\x42\x6f\xf6\xe6\xbe\x51\xc5\x0a\xf4\x60\x9b\xc7\x15\xd8\xf4\x22\xe8\xe6\xe4\xe2\x21\x27\x74\xc3\x38\x6b\xe2\xc8\x55\x3c\xcb\x1f\x25\xdf\xb0\x6d\x66\xbc\x75\x34\x9d\xa8\x7b\x58\xa1\x0c\x0b\x81\x5f\xbb\xad\x47\x57\x1d\x63\xd2\x6b\xfd\x4a\x10\x8c\x8f\x8f\xa1\xdf\x0b\x56\x18\xbe\xb3\x8e\x8e\xae\x79\xc7\x1c\x1a\x08\xdc\x14\xbc\xa7\xef\x2e\xc5\x3f\x65\x8b\x11\x0c\x78\xb9\x06\x10\xec\xb9\x06\x3a\xba\x36\x1d\x06\xe7\x92\x60\x1b\x51\x2a\x14\xe9\xc9\x33\x97\x04\xcf\x01\x25\xcb\x4f\x6d\xb9\xa1\xbb\xdb\xd1\x7f\xfd\xcb\x8b\x9e\x8b\x0c\x13\xd2\x64\x84\xf7\xbf\xfa\x30\xd9\xe0\xbd\xa4\xe7\x2d\xad\xa3\xf2\xf9\x85\x16\xd0\x12\x55\xaf\x18\xe6\x38\x5f\xda\xa1\x38\x49\x4d\xaf\x0e\xc8\xcd\x4c\xc0\x61\xb7\xc9\x4e\x2f\xb9\x49\x4f\x2f\xdb\xe4\xa7\x97\x9c\x24\xa8\x57\x1d\x64\xd8\x85\x69\x93\x62\x2f\x71\x9b\x1c\xf5\xa2\x41\x92\xed\xf3\x34\xe8\x9d\xc0\xf0\x42\x21\xf2\xec\x72\xf6\xe2\x43\x6f\x49\x82\x93\xce\x5b\x2c\xa9\xb6\xcf\xd1\xed\xd4\x07\x9f\xc0\x6b\x7e\xd2\x8d\x29\x4b\x88\xc0\x26\x88\x39\x44\xd2\x57\xc7\xe4\x72\xec\x23\xef\x6e\xc3\xec\x6a\xe1\x24\xfb\xab\x83\x71\x79\xbc\x80\x23\x34\x23\xa8\x84\xc4\x41\x20\x45\x74\x63\xad\xfd\xe2\x61\x6e\x85\x09\x8a\x8a\x09\x2a\xe3\x15\x1d\x73\x2b\x4c\x48\x8c\x4c\x51\x17\x97\x58\xb1\x1c\xc6\xa0\xd3\x27\x62\xae\x77\x1a\x14\x60\x97\x45\x8e\x75\xd0\x59\xec\x38\x25\x97\xc9\x65\x91\x6a\xe7\x74\x81\x11\x62\x47\x52\x00\xc6\xb7\x4e\x01\xc1\x88\x53\x03\x61\xc0\xe3\x34\x45\xe3\xe1\xe2\x55\x0c\x2b\xd4\x3e\x4e\x0a\x22\x69\xfb\x45\xa1\x20\xa1\x43\x5d\xe6\xa4\x69\x8f\x04\xca\x3d\x7b\x7a\x40\x3a\x56\x53\x27\x3e\x6e\x38\xca\x23\x41\xf4\x41\x3a\xff\x9e\x0d\xd0\x72\xc8\xba\x19\x6e\x73\x9e\x6d\x0e\xfb\x7a\x78\x1d\xb1\x17\x7f\x72\xe0\xbd\x27\x4f\xa5\x41\xd4\xf4\x02\xa9\xc6\x74\xca\xcc\x7a\xcf\xe5\x2f\xf1\xd0\x65\xbc\xaa\x03\x65\xbf\x25\xe5\xb2\x86\xe4\x3e\x3f\xc9\x66\xaa\x59\x93\x72\xf8\xfb\x86\x8c\x67\x26\x85\x66\xcf\x0e\x73\xb2\x3f\xe9\xfe\x51\x23\x45\x7b\xf9\x5f\x7e\x3d\xfc\x54\x01\xdf\xe9\x47\xc4\xa7\x24\xbc\x25\xce\xf7\x40\xa9\xd9\x17\x91\x60\x0d\xe1\xec\x43\xfd\x01\xea\xd4\x57\x53\x83\x2c\xfd\xff\x68\x09\x50\x31\x79\x0f\x2f\xd4\xe7\xf1\x5f\x00\x00\x00\xff\xff\x74\xac\x4c\xb6\x8d\x1f\x00\x00") +var _schemaJson = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\x58\x4d\x6f\x9c\x30\x10\xbd\xef\xaf\xb0\x9c\x1e\x9b\xa5\xb7\x4a\xdc\xa2\x5e\x7a\xa9\xd4\x7b\x95\x83\x83\x0d\xeb\x88\xb5\xa9\x31\x95\xa2\x68\xff\x7b\x85\xf9\x58\x0c\xb6\xf9\x32\x1b\x12\x65\x0f\x91\x18\xdb\xcf\x33\xc3\xcc\xbc\x17\x5e\x0f\x00\x00\x00\xbf\xe4\xd1\x89\x9c\x11\x0c\x01\x3c\x49\x99\x85\x41\xf0\x9c\x73\x76\x5f\x59\x8f\x5c\x24\x01\x16\x28\x96\xf7\xdf\xbe\x07\x95\xed\x0e\x7e\xad\x4e\x0a\xf2\xb7\xa0\x82\x60\x18\x82\x3f\xca\xa2\xac\x0c\x9d\x49\xbd\x43\x3d\xcb\x97\x4c\x7b\xfe\x47\x44\x4e\x39\xeb\x9a\x30\xc9\x23\x41\x33\xd9\x33\xa3\x2c\xfb\xc5\x31\x49\xa1\x32\x3d\xd6\xb7\x66\x82\x67\x44\x48\x4a\x72\x18\x82\xd7\xce\xee\xa8\x3c\xaf\x1b\xd5\x02\x95\xe4\x3c\x34\xaf\x8b\x5d\x47\x11\x24\x2e\x21\xee\x02\x4c\x62\xca\xa8\xf2\x23\xa8\xfc\x39\xfe\xe0\x2c\xa6\x09\xd4\x4e\x5d\x74\x90\x2a\x45\x21\x80\x48\x08\xf4\x72\xdd\x7a\x31\xe5\x62\x10\x5e\x73\x38\x97\x82\xb2\xc4\x7c\x3a\x3a\x21\xc6\x48\x3a\x2f\x39\x36\xe0\x85\x11\x74\x5f\xf2\xa2\x20\xe8\x39\xe3\x42\xbe\x69\x0c\xaa\xb6\x17\x39\x6f\xa9\xda\x31\xff\xb7\x2c\x50\x8c\x24\x3a\x3e\x48\x29\xe8\x53\x21\xc9\xea\xdc\x08\x92\xf3\x42\x44\x3b\x0a\xb0\xf1\xc8\x57\x0f\x4a\x41\x93\x84\x88\xfd\x04\x58\x3b\xe4\x2d\xbe\x6a\xcb\x82\xea\x6e\x66\xfa\xf4\xc3\x87\x0e\x04\x44\x18\xab\x88\x50\xfa\xbb\xdb\x26\x31\x4a\x73\x52\x6f\x69\x80\xf8\xd3\x33\x89\x64\xc3\x40\x9d\x64\xe8\x64\x70\x1c\xba\x62\x64\xab\x76\xb5\xc7\x5a\x7a\x00\x06\xfb\x90\xc5\xda\x25\x33\x9b\xb5\xcb\x3a\xab\x35\xbf\xc7\xde\xeb\x72\xcc\x0b\xe0\x62\xbb\x76\x83\xbd\x24\xdb\x2d\x5e\x4a\xf3\x8a\x36\x97\x05\x9b\xdf\xc5\x0c\x6a\xab\x58\xc7\x31\x3b\x4b\x0e\x40\x4d\x84\x60\x43\xb5\xb2\x67\xbb\x63\x42\xb2\xc7\x2e\xb6\x5c\x0e\x16\x66\xc2\xc5\xb6\x93\x7d\x32\x01\xdb\x58\xf8\xba\x61\x77\xb9\x30\xb2\xf6\x64\x67\x4c\x88\x23\xdd\x09\x76\xd4\x80\x2e\x96\x77\x84\x08\x16\xe6\xda\xae\x02\xf6\x96\x18\xa7\x3a\xd8\x20\x33\x56\xf5\xb0\xb7\xc4\xb8\x54\xc5\x16\x79\x31\xa9\x8e\x01\xe0\x9c\xee\xb4\xa9\x91\xe9\xa0\x4e\x25\x35\xae\x56\x06\x17\xd5\xaa\xc5\xfc\x9f\x9d\xc6\x90\x03\xd9\x32\x26\x04\xca\xfe\x1e\x8f\xb4\xef\x80\x25\x36\x75\x86\x62\xbf\xaf\xa3\x2a\x32\x8f\x80\x39\x91\x92\xb2\xc4\xd1\x49\x4b\xc2\x5e\x59\x87\xb7\x2c\x99\xde\x4c\x1f\xd4\x8c\xe7\xeb\xfa\x93\x72\xa6\xb4\xa6\xd8\xa8\x92\xcb\xba\x5d\x25\x81\x77\x56\xf9\xb7\x2c\x80\x66\x44\x3f\xa8\xd9\xf1\x71\x47\x07\xf5\x3c\x39\x28\xcb\x0a\xe9\x37\x64\x5e\x48\xef\x98\x9f\x13\x73\xab\x86\xf1\x39\xc1\xda\xa4\x1a\xd6\x4e\x88\xe1\xb4\x14\x7b\xab\x26\x5c\x8b\xf2\x5e\x24\xe3\xcf\xca\xe1\x1b\x29\xc7\x4f\xa1\xb2\xc4\xcf\xb7\x68\x3b\xbd\x2e\x66\x76\x9f\xab\xcf\x9a\xcf\x60\xab\xda\xec\xbd\x7c\x4b\x33\xb2\xfe\xd6\x4d\xe6\xff\xe3\x89\x87\xae\xd8\xbc\x86\x0f\xd5\xdf\xcb\xff\x00\x00\x00\xff\xff\x83\xb2\x9c\x13\x24\x1d\x00\x00") func schemaJsonBytes() ([]byte, error) { return bindataRead( @@ -83,7 +83,7 @@ func schemaJson() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "schema.json", size: 8077, mode: os.FileMode(436), modTime: time.Unix(1547818534, 0)} + info := bindataFileInfo{name: "schema.json", size: 7460, mode: os.FileMode(436), modTime: time.Unix(1547822043, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/internal/schema/schema.json b/internal/schema/schema.json index 9a1a164d..5d3c5a1f 100644 --- a/internal/schema/schema.json +++ b/internal/schema/schema.json @@ -5,12 +5,7 @@ "type", "version", "description", - "imports", - "properties", - "channels", - "triggers", - "resources", - "actions" + "appModel" ], "properties": { "actions": { @@ -20,6 +15,9 @@ }, "type": "array" }, + "appModel": { + "type": "string" + }, "channels": { "items": { "type": "string" @@ -75,12 +73,7 @@ "type", "version", "description", - "imports", - "properties", - "channels", - "triggers", - "resources", - "actions" + "appModel" ], "properties": { "actions": { @@ -90,6 +83,9 @@ }, "type": "array" }, + "appModel": { + "type": "string" + }, "channels": { "items": { "type": "string" @@ -140,13 +136,6 @@ "type": "object" }, "action.Config": { - "required": [ - "ref", - "type", - "settings", - "id", - "data" - ], "properties": { "data": { "type": "object" @@ -188,19 +177,7 @@ "type": "object" }, "trigger.ActionConfig": { - "required": [ - "ref", - "type", - "settings", - "id", - "data", - "Act" - ], "properties": { - "Act": { - "additionalProperties": true, - "type": "object" - }, "data": { "type": "object" }, @@ -232,8 +209,6 @@ "trigger.Config": { "required": [ "id", - "type", - "ref", "settings", "handlers" ], diff --git a/trigger/config.go b/trigger/config.go index 4bc61036..0f544af8 100644 --- a/trigger/config.go +++ b/trigger/config.go @@ -12,8 +12,8 @@ import ( // Config is the configuration for a Trigger type Config struct { Id string `json:"id"` - Type string `json:"type"` //an alias to the ref, can be used if imported - Ref string `json:"ref"` + Type string `json:"type,omitempty"` //an alias to the ref, can be used if imported + Ref string `json:"ref,omitempty"` Settings map[string]interface{} `json:"settings"` Handlers []*HandlerConfig `json:"handlers"` } @@ -94,7 +94,7 @@ type ActionConfig struct { Input map[string]interface{} `json:"input,omitempty"` Output map[string]interface{} `json:"output,omitempty"` - Act action.Action + Act action.Action `json:"-,omitempty"` } // UnmarshalJSON overrides the default UnmarshalJSON for TaskInst