apache / servicecomb-service-center

A standalone service center to allow services to register their instance information and to discover providers of a given service
Apache License 2.0
1.34k stars 343 forks source link

try to get the instances for a serviceId,but got value() does not match rule: error #333

Open lexkong opened 6 years ago

lexkong commented 6 years ago

[lkong@dev service-center-1.0]$ curl -XGET -H "Content-Type: application/json" -H 'x-domain-name: default' -d'{}' http://127.0.0.1:30100/registry/v3/instances
{"errorCode":"400001","errorMessage":"Invalid parameter(s)","detail":"The field 'FindInstancesRequest.ConsumerServiceId' value() does not match rule: {Min: 1,Length: 64,Regexp: ^.$}"} [lkong@dev service-center-1.0]$ ^C [lkong@dev service-center-1.0]$ curl -XGET -H "Content-Type: application/json" -H 'x-domain-name: default' -d'{}' http://127.0.0.1:30100/registry/v3/microservices/ea81c471487d11e889d714050a32e26e/instances {"errorCode":"400001","errorMessage":"Invalid parameter(s)","detail":"The field 'GetInstancesRequest.ConsumerServiceId' value() does not match rule: {Min: 1,Length: 64,Regexp: ^.$}"} [lkong@dev service-center-1.0]$

little-cui commented 6 years ago

you need to add header ‘x-consumerid’ in your request, please ref to api doc

tianxiaoliang commented 4 years ago

x-consumerid should not be a requied header, but a optional header

hityc2019 commented 4 years ago

I've checked the latest version, already fix it, can be close the issue.