获取构建定义响应正文缺少属性(Get Build Definition response body is missing properties)
我正在尝试通过TFS REST API v2.0运行请求,因为我希望能够在触发它之前修改特定BuildDefinition的'ProcessParameters'。 这样我就可以将参数传递给特定的BuildDefinition的部署脚本。
通过TFS SDK完成这项工作很好,但我不得不重构使用REST API,因为这必须在没有Visual Studio和TFS Team Explorer的生产机器上运行。
文档说我应该能够在我的查询中指定propertyFilter,但是我无法让它返回更多信息。 与我习惯使用SDK相比,我得到的是非常轻松的。
这是我的请求:https:// {instance} / DefaultCollection / {project} / _apis / build / definitions / {id}?api-version = 2.0&propertyFilters = processParameters
无论是否设置了“&propertyFilters = processParameters”部分,响应都完全相同。 它应该能够处理以逗号分隔的属性名称列表,但看起来它只是被忽略了。
我是否发现了API文档与实际API之间的差异,或者我们是否应该说出这些错误? 'propertyFilters'查询参数是否实际实现了? 我不能让它工作......
任何帮助都非常感谢!
I'm trying to run a request through the TFS REST API v2.0 because I would like to be able to modify the 'ProcessParameters' of a specific BuildDefinition before triggering it. This is so I can pass an argument to the specific BuildDefinition's deployment script.
Doing this work through the TFS SDK works fine, but I've had to refactor to use the REST API instead because this has to run on a production machine without Visual Studio and TFS Team Explorer.
The documentation says I should be able to specify a propertyFilter in my query, but I'm unable to get it to return more information. What I am getting is very light compared to what I'm used to working through the SDK.
Here is my request: https://{instance}/DefaultCollection/{project}/_apis/build/definitions/{id}?api-version=2.0&propertyFilters=processParameters
The response is exactly the same whether or not the "&propertyFilters=processParameters" part is set. It should be able to handle a comma-delimited list of property names but seemingly it is just ignored.
Have I found a bug, or shall we say, a discrepancy between the API documentation and the actual API? Is the 'propertyFilters' query parameter actually implemented? I can't get it to work...
Any help is highly appreciated!
原文:https://stackoverflow.com/questions/36398765
最满意答案
Chrome没有任何区别,但我建议您使用localStorage.removeItem(key),以便您习惯这样做。 这样,当您在网站中使用localStorage时,您已经使用最有可能使用垫片和polyfills的方法过时的浏览器。
There's no difference in Chrome, but i recommend using localStorage.removeItem(key) so that you get in the habit of doing so. That way, when you go to use localStorage in a website, you are already using the method that is most likely to work with shims and polyfills for outdated browsers.
相关问答
更多-
本地存储被键入到原点。 因此,如果您的所有项目都在本地主机上运行,那么当您使用clear()时您将清除所有值,唯一安全的方法是单独清除。 在生产环境中,每个项目都应该有自己的域名,并且clear应该是安全的。 所以这是一个知道当前原点还有什么的问题。 如果您控制当前原点上的所有内容,并且不介意全部clear() , clear()是最佳选择并且是为此设计的。 如果您的代码的其他部分使用localstorage或其他托管在相同原点的项目,那么您将希望更具选择性并使用removeItem() 。 localst ...
-
从localStorage删除:应该使用delete或.removeItem吗?(Deleting from localStorage: should I use delete or .removeItem?)[2023-09-11]
Chrome没有任何区别,但我建议您使用localStorage.removeItem(key),以便您习惯这样做。 这样,当您在网站中使用localStorage时,您已经使用最有可能使用垫片和polyfills的方法过时的浏览器。 There's no difference in Chrome, but i recommend using localStorage.removeItem(key) so that you get in the habit of doing so. That way, wh ... -
我是否需要在setItem之前从localStorage中删除Item?(Do I ever need to removeItem from localStorage before setItem?)[2023-03-31]
不,他们绝对没有理由。 如果变量已经存在,那么它将被覆盖,因此在设置之前无需删除。 它会产生差异的唯一方法是在this.data的字符串化过程中出现异常,但除非这些数据中存在某些奇怪的东西(如圆形结构),否则它不会发生。 No, they're absolutely no reason for that. If the variable already exists then it will be overwritten, so no need to remove before setting. The o ... -
您遇到错误的原因是, test在代码范围内不可用(并且在尝试访问尚未定义的变量时引发引用错误)。 在你的情况下,它依赖于localStorage.test因为你直接将它连接到localStorage对象。 如果您使用过localStorage.removeItem(localStorage.test); 相反,你不会遇到错误。 直接在localStorage对象上设置属性并不是一个好主意。 而是使用setItem将数据存储在本地存储中。 var value = "good"; localStorage.s ...
-
JavaScript循环停止在“localStorage.removeItem”(JavaScript loop stops on “localStorage.removeItem”)[2023-11-28]
您正在迭代类似数组的对象,同时删除其条目。 这不能起作用,因为每次删除时条目顺序都会混淆在一起。 考虑这个例子。 第一次迭代删除条目#1: Entry key value #1 my-first-key my-first-value #2 my-2nd-key my-2nd-value 第二次迭代尝试删除条目#2: Entry key value #1 my-2nd-key my-2nd-val ... -
重命名该功能 remove(); 至 removeStorage(); 记得也要更新onClick。 remove(); 在没有调用你的功能的按钮上运行! 一个更成功的功能是: function UpdateWeight(inputID){ localStorage.userInfo = document.getElementById(inputID).value; document.getElementById("result").innerHTML = localStora ...
-
不要使用getItem方法。 null是一个错误的返回,例如: 错误的返回值 (针对非现有的键)由fellas引入来自静态过程语言的JavaScript,它们根本不理解JavaScript。 为了避免混淆,请使用规范的localStorage[key]调用以获取undefined返回值,或者确保该键不存在,以使用操作符中最强大的JS作为: "x" in localStorage > true/false don't use the getItem method. null is a mistaken ret ...
-
删除LocalStorage(Deleting LocalStorage)[2023-01-02]
您的第一步需要从localStorage获取所有这些密钥。 这可以使用Object.keys完成 var allKeys = Object.keys(localStorage); 然后你只需找出哪一个是最新的并删除其余的 var sorted = allKeys // Use regex to find your keys of interest .map(key => key.match(/__user_information_([0-9]+)/)) // Filter out those ... -
尝试使用setItem()并将值设置为null或blank如, $(".delete").on("click", function() { localStorage.setItem('Property',""); }); 根据@qutz评论更新 ,如果您有多个项目,那么首先您需要以JSON格式存储值,然后您将能够解析和拼接以删除单个项目,如 $(".delete").on("click", function() { var ar = JSON.parse(localStorage.getIt ...
-
如何删除dataTables中localstorage中表中的特定行(How to delete specific row in table in localstorage in dataTables)[2022-02-25]
不是很好,而是基于比较姓名,年龄和性别的工作实例: $(document).on('click', '.delete', function () { var row = $(this).closest('tr'); oTable.row(row).remove().draw(); var rowElements = row.find("td"); for (var i = 0; i < dataSet.length; i++) { var equals = t ...