diff --git a/go.mod b/go.mod index abc52195d..c93933c41 100644 --- a/go.mod +++ b/go.mod @@ -6,8 +6,8 @@ require ( bitbucket.org/bertimus9/systemstat v0.5.0 github.com/OneOfOne/xxhash v1.2.8 github.com/edgexfoundry/go-mod-bootstrap/v3 v3.0.0-dev.7 - github.com/edgexfoundry/go-mod-core-contracts/v3 v3.0.0-dev.2 - github.com/edgexfoundry/go-mod-messaging/v3 v3.0.0-dev.3 + github.com/edgexfoundry/go-mod-core-contracts/v3 v3.0.0-dev.3 + github.com/edgexfoundry/go-mod-messaging/v3 v3.0.0-dev.4 github.com/edgexfoundry/go-mod-registry/v3 v3.0.0-dev.3 github.com/google/uuid v1.3.0 github.com/gorilla/mux v1.8.0 diff --git a/go.sum b/go.sum index 95cb7e641..364b0846d 100644 --- a/go.sum +++ b/go.sum @@ -49,10 +49,10 @@ github.com/edgexfoundry/go-mod-bootstrap/v3 v3.0.0-dev.7 h1:e0H7V7aFl9vC06ZUUQUz github.com/edgexfoundry/go-mod-bootstrap/v3 v3.0.0-dev.7/go.mod h1:yW5dumg9IyfrHx4NYC5Ii0WVVB5OjTXQ/8/NkHHif5Q= github.com/edgexfoundry/go-mod-configuration/v3 v3.0.0-dev.2 h1:xp5MsP+qf/fuJxy8fT7k1N+c4j4C6w04qMCBXm6id7o= github.com/edgexfoundry/go-mod-configuration/v3 v3.0.0-dev.2/go.mod h1:1Vv4uWAo6r7k6jUlqVJW8JOL6YKVBc6sRL8Al3DrMck= -github.com/edgexfoundry/go-mod-core-contracts/v3 v3.0.0-dev.2 h1:tleTxhbBISfDNn596rU71n+GOy27dMIme+v8Vl0uhpw= -github.com/edgexfoundry/go-mod-core-contracts/v3 v3.0.0-dev.2/go.mod h1:7RwSq896VqelvSU7zYKs2tpZhgELVFECkiGf6XGLKfQ= -github.com/edgexfoundry/go-mod-messaging/v3 v3.0.0-dev.3 h1:+el2HxEt02uFXXBmHK8gWETPklNbPg4wvYln/4/ooHo= -github.com/edgexfoundry/go-mod-messaging/v3 v3.0.0-dev.3/go.mod h1:G0Vxoc8+JXwUqRH5ggyOZ/f/CIVPTswI5Ld7dI5uhIY= +github.com/edgexfoundry/go-mod-core-contracts/v3 v3.0.0-dev.3 h1:Ia/y/w9w3SmXqIqJ+Vjmv6QrP49YJDpTY6262C1Jrzs= +github.com/edgexfoundry/go-mod-core-contracts/v3 v3.0.0-dev.3/go.mod h1:7RwSq896VqelvSU7zYKs2tpZhgELVFECkiGf6XGLKfQ= +github.com/edgexfoundry/go-mod-messaging/v3 v3.0.0-dev.4 h1:swPZOjoQ/IUIWSJpZCmQENtP/plFRx5tgiCEZgnfxFU= +github.com/edgexfoundry/go-mod-messaging/v3 v3.0.0-dev.4/go.mod h1:8pxuYvh2zcq1GuKqmk1MAuH1yuN40iOMmL0g2myIfwk= github.com/edgexfoundry/go-mod-registry/v3 v3.0.0-dev.3 h1:QgZF9f70Cwpvkjw3tP1aiVGHc+yNFJNzW6hO8pDs3fg= github.com/edgexfoundry/go-mod-registry/v3 v3.0.0-dev.3/go.mod h1:2w8v0sv+i21nY+DY6JV4PFxsNTuxpGAjlNFlFMTfZkk= github.com/edgexfoundry/go-mod-secrets/v3 v3.0.0-dev.1 h1:dib+mZUuHqwVHt9pKAWC4lh60Fbc+6vKrD919LaknwI= diff --git a/internal/controller/http/command.go b/internal/controller/http/command.go index f7ca6f3f7..f218604eb 100644 --- a/internal/controller/http/command.go +++ b/internal/controller/http/command.go @@ -46,12 +46,12 @@ func (c *RestController) GetCommand(w http.ResponseWriter, r *http.Request) { } // push event to CoreData if specified (default no) - if ok, exist := reserved[common.PushEvent]; exist && ok[0] == common.ValueYes { + if ok, exist := reserved[common.PushEvent]; exist && ok[0] == common.ValueTrue { go sdkCommon.SendEvent(event, correlationId, c.dic) } // return event in http response if specified (default yes) - if ok, exist := reserved[common.ReturnEvent]; !exist || ok[0] == common.ValueYes { + if ok, exist := reserved[common.ReturnEvent]; !exist || ok[0] == common.ValueTrue { res := responses.NewEventResponse("", "", http.StatusOK, *event) c.sendEventResponse(w, r, res, http.StatusOK) return diff --git a/internal/controller/http/command_test.go b/internal/controller/http/command_test.go index cf111ead4..fcc5b00bd 100644 --- a/internal/controller/http/command_test.go +++ b/internal/controller/http/command_test.go @@ -305,7 +305,7 @@ func TestRestController_GetCommand_ReturnEvent(t *testing.T) { require.NoError(t, err) query := req.URL.Query() - query.Add("ds-returnevent", "no") + query.Add("ds-returnevent", common.ValueFalse) req.URL.RawQuery = query.Encode() // Act recorder := httptest.NewRecorder() diff --git a/internal/controller/messaging/command.go b/internal/controller/messaging/command.go index ef63630b5..28537c7a0 100644 --- a/internal/controller/messaging/command.go +++ b/internal/controller/messaging/command.go @@ -216,11 +216,11 @@ func filterQueryParams(queries map[string]string) (string, bool, bool) { var rawQuery []string pushEvent, returnEvent := false, true for k, v := range queries { - if k == common.PushEvent && v == common.ValueYes { + if k == common.PushEvent && v == common.ValueTrue { pushEvent = true continue } - if k == common.ReturnEvent && v == common.ValueNo { + if k == common.ReturnEvent && v == common.ValueFalse { returnEvent = false continue } diff --git a/openapi/v2/device-sdk.yaml b/openapi/v2/device-sdk.yaml index 729d183d7..3c8b114b4 100644 --- a/openapi/v2/device-sdk.yaml +++ b/openapi/v2/device-sdk.yaml @@ -1095,21 +1095,21 @@ paths: schema: type: string enum: - - yes - - no - default: no - example: yes - description: "If set to yes, a successful GET will result in an event being pushed to the EdgeX system" + - true + - false + default: false + example: true + description: "If set to true, a successful GET will result in an event being pushed to the EdgeX system" - in: query name: ds-returnevent schema: type: string enum: - - yes - - no - default: yes - example: no - description: "If set to no, there will be no Event returned in the http response" + - true + - false + default: true + example: false + description: "If set to false, there will be no Event returned in the http response" responses: '200': description: String as returned by the device/sensor through the device service.