rpcbinding: properly add imports for simple types of event parameters

There are two ways of doing this: first one is to emit all notifications
parameter data into rpcbindings configuration on compile time (event if
the parameter has a simple type), and the second one is to fetch parameter
type from the manifest on rpcbinding file generation if needed (we always
have manifest at this stage, thus it's not a problem to retrieve necessary
information). The latter case is chosen to reduce the bindings configuration
file size.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
This commit is contained in:
Anna Shaleva 2023-05-23 18:20:51 +03:00
parent 19cc6c6369
commit 37af2031bb
4 changed files with 4 additions and 3 deletions

View file

@ -347,8 +347,6 @@ func CompileAndSave(src string, o *Options) ([]byte, error) {
eStructName := rpcbinding.ToEventBindingName(e.Name)
for _, p := range e.Parameters {
pStructName := rpcbinding.ToParameterBindingName(p.Name)
// TODO: proper imports handling during bindings generation (see utf8 example).
// Probably, we should always add p type to the list of types.
if p.ExtendedType != nil {
pName := eStructName + "." + pStructName
cfg.Types[pName] = *p.ExtendedType