X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=dmaap-mediator-producer%2Finternal%2Fconfig%2Fregistrator.go;fp=dmaap-mediator-producer%2Finternal%2Fconfig%2Fregistrator.go;h=db46c54452a41bfad9cb2e69edc7254330cf17f3;hb=382870d3056e724f1e587ab21cd25411bceaaac7;hp=37225eda5e850a8c9cdfa44837b2b3dda4dfb376;hpb=82378715d387362e97a064665a2467c587afdeed;p=nonrtric.git diff --git a/dmaap-mediator-producer/internal/config/registrator.go b/dmaap-mediator-producer/internal/config/registrator.go index 37225eda..db46c544 100644 --- a/dmaap-mediator-producer/internal/config/registrator.go +++ b/dmaap-mediator-producer/internal/config/registrator.go @@ -33,9 +33,10 @@ import ( const registerTypePath = "/data-producer/v1/info-types/" const registerProducerPath = "/data-producer/v1/info-producers/" +const typeSchema = `{"type": "object","properties": {},"additionalProperties": false}` type Registrator interface { - RegisterTypes(types []*jobs.Type) error + RegisterTypes(types []*jobs.TypeData) error RegisterProducer(producerId string, producerInfo *ProducerRegistrationInfo) } @@ -49,9 +50,9 @@ func NewRegistratorImpl(infoCoordAddr string) *RegistratorImpl { } } -func (r RegistratorImpl) RegisterTypes(jobTypes []*jobs.Type) error { +func (r RegistratorImpl) RegisterTypes(jobTypes []jobs.TypeData) error { for _, jobType := range jobTypes { - body := fmt.Sprintf(`{"info_job_data_schema": %v}`, jobType.Schema) + body := fmt.Sprintf(`{"info_job_data_schema": %v}`, typeSchema) if error := restclient.Put(r.infoCoordinatorAddress+registerTypePath+url.PathEscape(jobType.TypeId), []byte(body)); error != nil { return error }