edgexfoundry / core-command-go

3 stars 10 forks source link

The Command Path in DeviceService cannot be composed correctly if the Command is read-only (get only) #16

Closed cloudxxx8 closed 6 years ago

cloudxxx8 commented 6 years ago

In device.go, commandByDeviceID function, line 62:

url := d.Service.Addressable.GetBaseURL() + strings.Replace(c.Put.Action.Path, DEVICEIDURLPARAM, d.Id.Hex(), -1)

That will be an issue if the command doesn't have a Put method. If the command is read-only, the path should come from c.Get.Action.Path