API Management Developer Portal从后端API更改输出(双) [英] API Management Developer Portal changing output from back-end API (double)

查看:106
本文介绍了API Management Developer Portal从后端API更改输出(双)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前,在开发人员门户网站中调用GET端点时,将返回以下对象:

Currently when calling a GET endpoint within the developer portal, the following object is returned:

[{" clientConfigurationID " ;:
" 759c57a3-2d64-48b7-8f95-2feb93734064"
"
systemNumber " ;:
123
"
sponsorNumber " ;:
4567
"
groupNumber " ;:
12349009.0
},{" clientConfigurationID " ;:
" ccf2a41c-e4ef-4dfe-87e6-4f6c30d7cb36"
"
systemNumber " ;:
234
"
sponsorNumber " ;:
5678
"
groupNumber " ;:
12345001.0
} ]

[{ "clientConfigurationID": "759c57a3-2d64-48b7-8f95-2feb93734064", "systemNumber": 123, "sponsorNumber": 4567, "groupNumber": 12349009.0 }, { "clientConfigurationID": "ccf2a41c-e4ef-4dfe-87e6-4f6c30d7cb36", "systemNumber": 234, "sponsorNumber": 5678, "groupNumber": 12345001.0 }]

groupNumber字段的值在显示中被错误表示并包含小数点。

The value of the groupNumber field is being mis-represented in the display and including a decimal point.

systemNumber和sponsorNumber是int32,groupNumber是double。

systemNumber and sponsorNumber are int32, groupNumber is a double.

实际的API(当通过邮递员运行时,返回上面没有".0"的结尾处groupNumber字段的值:

The actual API (when running through postman returns the above without the ".0" at the end of the groupNumber field's value:

我认为这是开发人员渲染中的一个错误。门户 我的想法是它应该将API的实际响应传递回最终用户的浏览器,但是看起来正在检查(和更改)值。

I believe this to be a bug in the rendering of the developer portal.  My thoughts are that it should be passing the actual response from the API back to the end-user's browser, however it appears something is inspecting (and changing) the values.

推荐答案

这取决于API实际发回的内容。您也应该能够在浏览器的开发者工具中看到响应的实际值。

It would depend on what the API is actually sending back. You should be able to see the actual value from the response in the developer tools of your browser too.

Postman似乎正在清理".0"。当视图设置为"漂亮"时。我相信你应该看到".0"。当选择'Raw'时,这是实际的响应。

Postman seems to be cleaning the ".0" when the view is set to 'Pretty'. I believe you should see the ".0" when 'Raw' is selected which is the actual response.


这篇关于API Management Developer Portal从后端API更改输出(双)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆