I've recently read about the upcoming breaking changes to the REST API GET relationships endpoint in the development blog post. It is certainly great that Jama development identifies performance issues with the API. However, we have made multiple tools that use this endpoint and have validated them for regulatory reasons. It would be great if Jama developers make the effort to update the rest client.py example at the Github repo to contain the two different GET relationship strategies they are illustrating. In this way, we can have a recommended usage and ease our transition to the new end point usage whenever that comes.Warm regards
I'd like to clarify that the update to GET relationships is not breaking.
We've updated GET relationships with some additional options that will result in better performance and will be reaching out to folks to adopt the new options. At some point we will be looking to deprecate the call as it is today, but there will be a EOL notice and target date.
Regarding the py_jama_rest_client which supposedly only will get updates when a customer pays to have them done, I have found that https://github.com/openapi-generators/openapi-python-client is now mature enough to generate a nice Python client with type annotations etc. from the API description file (after converting it to OpenAPI v3 format and fixing some bugs in the description file, namely removing some fields in the "required" section).
Hello Colin,I wasn't aware of this tool! It sounds very promising. Could you perhaps share more info on how to generate the API description file? Do you need for example to supply each endpoint? Or can this be done automatically?Warm regardsDimitrios
I downloaded the OpenAPI v2/Swagger file using curl with a command line like this
curl -u $USER -X GET https://<JAMA_URL>/rest/v1/api-docs -H "accept: application/json" -H "jama-csrf-token: <TOKEN>" -o jama_rest_api.swagger_2.0.json
(get TOKEN from your browser visiting https://<JAMA_URL>/api-docs and executing a request to any of the API endpoints).
You then take the resulting jama_rest_api.swagger_2.0.json and convert it using e.g. https://editor.swagger.io/, download it as e.g. jama_rest_api.openapi_3.0.yaml. That's the file you can give as input to the openapi-python-client tool.
Take a look at the README of your generated client to see how to use it. When you run the resulting client against Jama, depending on the endpoint used, you might get a Python exception (AttributeError I think) about a field missing. This is because the client validates the result, and the API sometimes does not return all fields, even though the spec lists them as required. To fix this, go into the YAML file, find the description of the relevant API endpoint, and remove the missing field name from the "required" list,.
Then re-generate the Python client. Repeat as needed.
@Steve Gotsch Is Jama interested in fixing these bugs in the API spec? I would probably be allowed to share the list of fixes I had to do with Jama Software, but not publicly.
------------------------------Colin MarquardtBosch Sensortec GmbH------------------------------
Original Message:Sent: 09-18-2023 02:17From: Colin MarquardtSubject: REST API - GET Relationships upcoming updates
------------------------------Colin MarquardtBosch Sensortec GmbHOriginal Message:Sent: 09-08-2023 00:39From: Dimitrios PananakisSubject: REST API - GET Relationships upcoming updates
HEADQUARTERS|135 SW Taylor Suite 200, Portland, Oregon, 97204