[Feature Request] Option to parse XML from Classic API endpoints
@brysontyrrell đang làm issue này rồi.
Từ ngày 28/11/2023.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 69
- Fork
- 16
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của macadmins/jamf-pro-sdk-python
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
-
[Bug] preview/mdm/commands deprecated & removed which breaks send_mdm_command_preview() method. Đang mởbug
macadmins/jamf-pro-sdk-python#68 · 1 bình luận · 1 người được giao ·
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 38/100
macadmins/jamf-pro-sdk-python#55 · 1 bình luận ·
-
[Feature Request] Pass a model to the Classic and Pro API request methods as the return type. Đang mởenhancement
macadmins/jamf-pro-sdk-python#52 · 1 bình luận · 2 người được giao ·
-
feedback
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
macadmins/jamf-pro-sdk-python#30 · 1 bình luận ·
Tất cả issue của macadmins/jamf-pro-sdk-python
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
xinnan-tech/xiaozhi-fde-talk#263 ·
-
rules
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
huggingface/Repo2RLEnv#163 · 1 bình luận ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 95/100
huggingface/sentence-transformers#4074 ·
-
comp/dashboard invalid P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
NousResearch/hermes-agent#121143 ·