[Feature Request] Option to parse XML from Classic API endpoints
@brysontyrrell 已经在做这个了。
开始于 2023年11月28日。
评估
这个 Issue 还没有评估数据。
描述
Currently, JSON responses are requested from the Classic API and can be parsed with the .json() method:
response = api.classic_api_request("GET", "accounts/userid/257")
user_info = response.json()
However, there's no equivalent option for parsing XML responses if the headers are overridden to request XML:
response = api.classic_api_request("GET", "accounts/userid/257", override_headers={"Accept": "application/xml"})
user_info = response.xml() # this doesn't exist
Some orgs may benefit from the ability to choose between XML and JSON responses. One use case would be working around Jamf product issues that affect the accuracy of information returned via one format — like PI104345: /accounts endpoint giving different results when searching by userid vs. username.
Proposal
The SDK could provide an .xml() method similar to the existing .json() method that converts XML responses to dictionary form, possibly leveraging a module like xmltodict to do the work behind the scenes.
Alternatively, the response could contain a .data attribute that provides the relevant information in structured data (lists or dicts) regardless of what serialization format was requested — a parsed equivalent to .text. This attribute could replace both .json() and .xml() functionalities.
Thanks for considering.
- 主要语言
- Python
- 星标
- 69
- 派生
- 16
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
macadmins/jamf-pro-sdk-python 的其他 Issue
-
enhancement
难度 5/5 一周以上 新手友好度 25/100
-
bug
macadmins/jamf-pro-sdk-python#68 · 1 条评论 · 已指派 1 人 ·
-
bug
难度 3/5 1-2 天 新手友好度 38/100
macadmins/jamf-pro-sdk-python#55 · 1 条评论 ·
-
enhancement
macadmins/jamf-pro-sdk-python#52 · 1 条评论 · 已指派 2 人 ·
-
feedback
难度 5/5 一周以上 新手友好度 35/100
macadmins/jamf-pro-sdk-python#30 · 1 条评论 ·
查看 macadmins/jamf-pro-sdk-python 的全部 Issue
相似的 Issue
-
area: harness bug status: needs-triage
难度 2/5 1-3 小时 新手友好度 75/100
Human-Agent-Society/reef#625 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 1/5 1 小时以内 新手友好度 80/100
learningequality/kolibri#15351 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
Name consistency 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
eellak/triplestore#65 · 1 条评论 ·