RicoSuter/NSwag

Question: Can I use .map() function inside my component?

Open

#1,008 创建于 2017年10月23日

在 GitHub 查看
 (0 评论) (0 反应) (0 负责人)C# (6,291 star) (1,189 fork)batch import
help wantedtype: question

描述

Hi, I am using NSWAG with Web API. On the client-side, inside my component, can I call a function on the code generated by NSWAG and then apply a .map() function before I use .subscribe()?

I need to transform the data and I don't want change in the generated code.

I am trying to use .map() and I am getting an error, something as the one shown in the snapshot.

image

This is the exception: ERROR TypeError: Cannot convert undefined or null to object at Function.keys () at deserialization.js:7 at deserialization.js:21 at funcs.js:16 at Array.reduceRight () at funcs.js:16 at Array.map () at translateDataSourceResultGroups (deserialization.js:33) at MapSubscriber.project (securityMatrixBinding.directive.ts:78) at MapSubscriber.webpackJsonp.../../../../rxjs/operator/map.js.MapSubscriber._next (map.js:77)

The variable result is being undefined, not value (MapSubscriber._next).

Thanks Bilal

贡献者指南