你如何返回app引擎python端点的部分响应? [英] How do you return a Partial response in app engine python endpoints?

查看:131
本文介绍了你如何返回app引擎python端点的部分响应?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在学习端点,并看到其他Google API具有此字段查询属性。

此外,它也出现在api资源管理器中。



我也想为我的api获得部分响应,但是当使用api资源管理器中的字段选择器时,它会被服务器忽略。

是否需要在服务器端实现某些功能?

在文档中找不到任何内容。

欢迎任何帮助。



我假设他们是否让我们知道,它可能需要注释,并可能覆盖一个或两个方法。



我也一直在寻找,无济于事。
我一直在寻找这只是由于相关的问题,我想知道如何在来自我的谷歌端点API的响应中强制JSON对象,甚至包括类的成员空值。
我试图查看是否会返回任何东西,如果我使用了一个字段的部分响应,表明它是空的。答案是否至少有属性,或者它甚至不会作为属性存在。 / p>

无论如何,这导致我进入相同的研究,我不相信我们可以在我们自己的API中启用部分响应。


I am learning endpoints and saw that other Google APIs have this "fields" query attribute.
Also it appears in the api explorer.

I would like to get a partial response for my api also, but when using the fields selector from the api explorer it is simply ignored by the server.
Do I need to implement something in the server side?
Haven't found anything in the docs.
Any help is welcome.

解决方案

From what I gather, Google has enabled partial response for their APIs, but has not yet explained how to enable it for custom APIs. I'm assuming if they do let us know, it might entail annotations, and possibly overriding a method or two.

I've been looking also, to no avail. I've been looking into this just due to a related question, where I'd like to know how to force the JSON object in the response from my google Endpoint API, to include even the members of the class that are null valued. I was trying to see if anything would be returned if I used a partial response with a field indicated that was null.. would the response have the property at least, or would it still not even exist as a property.

Anyway, this lead me into the same research, and I do not believe we can enable partial responses in our own APIs yet.

这篇关于你如何返回app引擎python端点的部分响应?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
其他开发最新文章
热门教程
热门工具
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆