Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for adding item type to project ( api/projects/{projectId}/itemtypes/{itemTypeId} ) #55

Open
austinhallett opened this issue Jul 13, 2023 · 3 comments

Comments

@austinhallett
Copy link

Is your feature request related to a problem? Please describe.
not that I could find

Describe the solution you'd like
I would like to be able to use the python jama client to add an existing item type to a project
/projects/{projectId}/itemtypes/{itemTypeId}

Describe alternatives you've considered
Generating my own python jama client using the openapi generator

Additional context
I am wondering if this API is missing from the client, what else could be missing? it would be best to generate this client using openapi generator as to not miss any api actions

@leyhline
Copy link

I concur. Is there any advantage in using this client instead of simply generating the code from the OpenAPI specification?

When using OpenAPI Generator I get a client for all available endpoints including type hints and pydantic validation.

I need to work with the REST API and have to make an informed decision on the client we use.

@leyhline
Copy link

I would like to add some details how py-jama-rest-client and the generated OpenAPI client compare.

In general, generating client code with OpenAPI generator works quite okay. The OpenAPI specification JSON from Jama is not 100% correct, therefore one has to add the --skip-validate-spec flag when calling the generator. For most programming languages this works without problems. But Python is different.

As written above, the generated Python code is quite sophisticated and uses (among others) the pydantic package to make sure the data exchanged with the API has the correct type. Unfortunately, since the JSON specification file from Jama is not fully correct the generated code also does not work out of the box. The pydantic checks are too pedantic. I mostly ran into problems with the child_item_type for items, where this field did not exist in practice but was expected by the client. Furthermore, marshalling responses had some problems where there was a HTTP status code different from 200 (for example "201 Created"). In the JSON specification, a successful operation is always indicated by code 200, but this is not how the Jama REST API actually works.

In conclusion, it seems easier to use py-jama-rest-client and add missing functionality inside application code. The Python code generated from the OpenAPI specification needs too much additional work to work correctly and the additional checks and types are not fully reliable, unfortunately. It would be best if the OpenAPI specification from Jama was to be corrected.

@austinhallett
Copy link
Author

@leyhline Thanks for your analysis. As a result, I have created a new client package py-jama-client. please review and let me know if this is any better

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants