Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to unmarshal event, SimpleReading.Value field is required when a reading contains empty string value #753

Closed
jinlinGuan opened this issue Jul 28, 2022 · 0 comments · Fixed by #831
Assignees
Labels
bug Something isn't working

Comments

@jinlinGuan
Copy link
Contributor

🐞 Bug Report

Affected Services [REQUIRED]

The issue is located in:

core-data

Is this a regression?

--

Description and Minimal Reproduction [REQUIRED]

When an event from a device service contains a reading with empty value for string type, the SimpleReading.Value validation fails.

🔥 Exception or Error

Remove the required validation in

Value string `json:"value" validate:"required"`

The value can still be checked by
if err := ValidateValue(b.ValueType, simpleReading.Value); err != nil {
return edgexErrors.NewCommonEdgeX(edgexErrors.KindContractInvalid, fmt.Sprintf("The value does not match the %v valueType", b.ValueType), nil)
}

🌍 Your Environment

Deployment Environment:

EdgeX Version [REQUIRED]:
main

Anything else relevant?

@jinlinGuan jinlinGuan added the bug Something isn't working label Jul 28, 2022
@cloudxxx8 cloudxxx8 added help wanted Extra attention is needed hacktoberfest labels Oct 11, 2022
@cloudxxx8 cloudxxx8 moved this from New Issues to Release Backlog in Technical WG Apr 19, 2023
@github-project-automation github-project-automation bot moved this to New Issues in Technical WG Apr 19, 2023
@cloudxxx8 cloudxxx8 removed help wanted Extra attention is needed hacktoberfest labels Apr 19, 2023
weichou1229 added a commit to weichou1229/go-mod-core-contracts that referenced this issue Apr 21, 2023
Since the string value might be empty from specified device, we need to remove SimpleReading value required validation for empty string.

Close edgexfoundry#753

Signed-off-by: bruce <[email protected]>
weichou1229 added a commit to weichou1229/go-mod-core-contracts that referenced this issue Apr 21, 2023
Since the string value might be empty from specified device, we need to remove SimpleReading value required validation for empty string.

Close edgexfoundry#753

Signed-off-by: bruce <[email protected]>
@github-project-automation github-project-automation bot moved this from Release Backlog to Minnesota Done in Technical WG Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
3 participants