[Feature Request] Option to parse XML from Classic API endpoints
@brysontyrrell ci sta già lavorando.
Dal 28/11/2023.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 69
- Fork
- 16
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di macadmins/jamf-pro-sdk-python
-
enhancement
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
-
[Bug] preview/mdm/commands deprecated & removed which breaks send_mdm_command_preview() method. Apertabug
macadmins/jamf-pro-sdk-python#68 · 1 commento · 1 assegnatario ·
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 38/100
macadmins/jamf-pro-sdk-python#55 · 1 commento ·
-
[Feature Request] Pass a model to the Classic and Pro API request methods as the return type. Apertaenhancement
macadmins/jamf-pro-sdk-python#52 · 1 commento · 2 assegnatari ·
-
feedback
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
macadmins/jamf-pro-sdk-python#30 · 1 commento ·
Tutte le issue di macadmins/jamf-pro-sdk-python
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
anthropics/skills#1811 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
speaches-ai/speaches#678 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
datalayer/mcp-compose#42 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
conda-forge/spacy-feedstock#177 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
UKGovernmentBEIS/inspect_evals#2523 ·