We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5e9daf1 commit c6cd436Copy full SHA for c6cd436
internal/template/load.go
@@ -65,7 +65,11 @@ func LoadThing(file string) (*iotclient.ThingCreate, error) {
65
66
// Adapt thing template to thing structure
67
delete(template, "id")
68
- template["properties"] = template["variables"]
+ vars, ok := template["variables"]
69
+ if !ok {
70
+ return nil, errors.New("loaded thing template doesn't have a `variables` field")
71
+ }
72
+ template["properties"] = vars
73
delete(template, "variables")
74
75
// Convert template into thing structure exploiting json marshalling/unmarshalling
0 commit comments