Comments (6)
core-metadata logs
level=ERROR ts=2019-05-02T15:23:59.724796665Z app=edgex-core-metadata source=rest_device.go:61 msg="invalid OperatingState \"\""
and returns HTTP 400 with the message
invalid OperatingState ""
from go-mod-core-contracts.
Related blackbox test PR edgexfoundry/blackbox-testing#207
from go-mod-core-contracts.
@tsconn23 this issue is blocking the Device Services working with core-metadata, including the new black box test of virtual device service. May we merge the fix made by @iain-anderson first?
add @cherrycl , @FelixTing for awareness
from go-mod-core-contracts.
@iain-anderson @tsconn23 @cloudxxx8 Replace value receiver with pointer receiver can fix this bug.
func (as *AdminState) Validate() (bool, error) {
_, found := map[string]AdminState{"LOCKED": Locked, "UNLOCKED": Unlocked}[string(*as)]
}
see my PR-#90
from go-mod-core-contracts.
@iain-anderson @tsconn23 @cloudxxx8 I'm having the same problem. I fix invalid OperatingState ""
, but the problem with json formatting cascading, however, is that when adding a device, i must specify the address name or id of the device service. Now i can only remove the code of verify the addressable to add the device successfully.
if not it will return Addressable ID and Name are both blank
, which is address of DeviceService.
so i have to add the field address of DS as following show:
{
"name":"mqtt-device-01",
"adminState":"UNLOCKED",
"operatingState":"ENABLED",
"protocols":{
},
"service":{
"name":"localhost",
"addressable":{
"name":"xxx"
}
},
"profile":{
"name":"test-mqtt-profile"
}
}
or i remove the Validate code in the Addressable model :
func (a Addressable) Validate() (bool, error) {
if !a.isValidated {
// if a.Id == "" && a.Name == "" {
// return false, NewErrContractInvalid("Addressable ID and Name are both blank")
// }
return true, nil
}
return a.isValidated, nil
}
from go-mod-core-contracts.
Merged PR #86. See my comment there. In my opinion, this is indicative of a larger refactoring effort that needs to be done.
from go-mod-core-contracts.
Related Issues (20)
- Create URL encoding wrapper function
- how to cancel the DTO validation? HOT 3
- Rename common/dummy_validator.go to fake_validator.go HOT 1
- Allow Device Profile to be empty string in ProvisionWatcher
- Move service name in Provision Watcher out of discovered device
- createRequest improperly combines baseUrl and path
- Define the min and max range for the edgex-dto-duration validate tag HOT 1
- Add new API route constants with path params for Echo
- feat: Use URL escape for DTO name field
- Validation of event with array value (from C Device Service) fails
- DeleteById missing from EventClient interface
- Change IssueSetCommandByName API signature to support object type and remove IssueSetCommandByNameWithObject
- Add the http clients/dtos of KVS and registry for Keeper HOT 3
- JSON unmarshal error in HTTP client utility functions
- Allow adding param to UpdateValuesByKey function of KVSClient
- Add AddWithQueryParams/UpdateWithQueryParams methods to device client
- Set command for resources with "/" on their name fails using the SDK (IssueSetCommandByName) HOT 5
- Remove the restrition of Device has to contain protocol properties
- Support ObjectArray value type
- Allow profileName to be empty string in Device
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-mod-core-contracts.