func validateServiceParameters(parameters []*Service_Parameter, data *types.Struct) error {
	var errs xerrors.Errors
	for _, p := range parameters {
		var value *types.Value
		if data != nil && data.Fields != nil {
			value = data.Fields[p.Key]
		}
		if err := p.Validate(value); err != nil {
			errs = append(errs, err)
		}
	}
	return errs.ErrorOrNil()
}
validateServiceParameters validates data to see if it matches with parameters schema.
package service
import (
	"fmt"
	"github.com/mesg-foundation/engine/ext/xerrors"
	"github.com/mesg-foundation/engine/protobuf/types"
)