You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this example, it looks like the resource value type is defined in String from the Device Profile, so the service treats it as a pure String field. If it's not string, users can define it as an object value type.
What is your expected behavior?
This can be an enhancement, not a but. Also, this could be validated in the Core Command service to make sure Device Service always receives right data type.
@cloudxxx8 correct, the resource value type is defined as String in the device profile. The expected behavior is to return a 400 error back to the user, as they passed in a json object.
cloudxxx8
changed the title
WriteDeviceResource allows any datatype to be written to a String type field
WriteDeviceResource should not allow any datatype to be written to a String type field
Jul 22, 2022
Feature request
Affected Services [REQUIRED]
device-sdk-go
device-onvif-camera
Is this a regression?
Not sure
Description and Minimal Reproduction [REQUIRED]
🔥 Exception or Error
Send a json object to a string value type:
See the value converted into a string containing the value type of
map
:See where the problem is coming from.
value
is ofmap
type, butv
was created byfmt.Sprint(value)
.thus causing validation to pass:
🌍 Your Environment
Deployment Environment:
EdgeX Version [REQUIRED]:
Anything else relevant?
The text was updated successfully, but these errors were encountered: