X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=inline;f=pkg%2Frestapi%2Foperations%2Freport%2Fsubscribe_report_responses.go;h=9e9d18d723aa7d0df5e6626e1d12a2fac422dfdf;hb=060448c051013852d463bc13bfc5f0aa3696ac9c;hp=d175d73100eabc3859b8c36b28949760f79d0823;hpb=3895a8c8775ef96652e6473414fdd7366c59f404;p=ric-plt%2Fxapp-frame.git diff --git a/pkg/restapi/operations/report/subscribe_report_responses.go b/pkg/restapi/operations/report/subscribe_report_responses.go index d175d73..9e9d18d 100644 --- a/pkg/restapi/operations/report/subscribe_report_responses.go +++ b/pkg/restapi/operations/report/subscribe_report_responses.go @@ -25,7 +25,7 @@ type SubscribeReportCreated struct { /* In: Body */ - Payload models.SubscriptionResult `json:"body,omitempty"` + Payload *models.SubscriptionResponse `json:"body,omitempty"` } // NewSubscribeReportCreated creates SubscribeReportCreated with default headers values @@ -35,13 +35,13 @@ func NewSubscribeReportCreated() *SubscribeReportCreated { } // WithPayload adds the payload to the subscribe report created response -func (o *SubscribeReportCreated) WithPayload(payload models.SubscriptionResult) *SubscribeReportCreated { +func (o *SubscribeReportCreated) WithPayload(payload *models.SubscriptionResponse) *SubscribeReportCreated { o.Payload = payload return o } // SetPayload sets the payload to the subscribe report created response -func (o *SubscribeReportCreated) SetPayload(payload models.SubscriptionResult) { +func (o *SubscribeReportCreated) SetPayload(payload *models.SubscriptionResponse) { o.Payload = payload } @@ -49,14 +49,11 @@ func (o *SubscribeReportCreated) SetPayload(payload models.SubscriptionResult) { func (o *SubscribeReportCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) { rw.WriteHeader(201) - payload := o.Payload - if payload == nil { - // return empty array - payload = models.SubscriptionResult{} - } - - if err := producer.Produce(rw, payload); err != nil { - panic(err) // let the recovery middleware deal with this + if o.Payload != nil { + payload := o.Payload + if err := producer.Produce(rw, payload); err != nil { + panic(err) // let the recovery middleware deal with this + } } }