Help with weird Siemens Polarion endpoints #1196
Unanswered
bigblondewolfpersonal
asked this question in
Q&A
Replies: 1 comment
-
I actually patched the SparseFields model, as it is used in all GET tequests, but I'm still wondering if that's right. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm further struggling with the Siemens Polarion REST API, which seems to be not perfectly specified and need your expert opinion.
Here's the API specification to play around, the test drive server is open, although Polarion itself is not. You may need to register and generate an API key to run queries: https://testdrive.polarion.com/polarion/rest/v1
What puzzles me is the
GET /projects/{projectId}/workitems
endpoint'sfield
item. It is defined as a SparseFields object, which should look like this:When I click "Try it out", this translates to
https://testdrive.polarion.com/polarion/rest/v1/projects/testproj/workitems?fields[categories]=@all&fields[documents]=@all
. This seems strange query format, is this universally accepted?The generated python client expects a SparseFields object that gets sent to the httpx request with to_dict() and each field is treated as an individual query parameter. When I call
wil : workitems_list_get_response.WorkitemsListGetResponse = get_work_items.sync_detailed(client=client, project_id="testproj", fields=SparseFields(categories="@all", documents="@all"))
this URL is requested:https://testdrive.polarion.com/polarion/rest/v1/projects/testproj/workitems?categories=@all&documents=@all')
I resolved it by patching get_work_items._get_kwargs() like this:
Is there anything better I colud do?
Am I misunderstading how to use the endpoint?
Or is it really weirdly coded?
Thanks a lot!
Beta Was this translation helpful? Give feedback.
All reactions