-
Notifications
You must be signed in to change notification settings - Fork 252
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
Add type attribute to Comment model #415
Add type attribute to Comment model #415
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
I have to check if we can add an integration test
@aheritier Thanks for the quick feedback. Let me know if I can contribute to the testing part — I didn't find an existing match so I wasn't sure how much coverage you want to have here. |
when possible @besbes I try to verify that we can serialize/deserialize the objects but yes I am not sure we have some tests in ITs for Comments |
@aheritier Let me know how I can support here. I couldn't find instructions how to run integration tests, what's the best way to check that? |
I applied the same pattern than others enum
We can write/read the field
Hi @besbes Did you test the code with a real zendesk instance? I get an error
I updated your code and modified some tests to validate it. could you have a look at it please ? |
@aheritier Yes I did (although not within this project because I didn't run integration tests). According to the JsonProperty javadoc this should work (and I'm using it in other projects too), so I'm not sure why it didn't for you? Happy to look into it — please just let me know how you run integration tests so I can try to reproduce. |
@aheritier Yes, thank you. I found the issue — it looks like |
Hi @besbes Ok it makes sense. Not sure why it was done like this (this project is old). I'll wait for a review from @PierreBtz , @Dohbedoh or @duemir before merging it and publishing a release |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something looks odd, the Comment object is only describing the COMMENT
type, the VOICE_COMMENT
type does not use the same model as per https://developer.zendesk.com/documentation/ticketing/managing-tickets/adding-voice-comments-to-tickets/.
As far as I understand the documentation, a VOICE_COMMENT
would not properly deserialize with this code.
@PierreBtz The specific JSON is only to create a comment of type Voice AFAIU. To read it it is the same, even if I am not sure how you get the URL and specific data for a voice comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, if we agree that this code can only work in "read only" mode then lgtm.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. Though there is a value for VOICE_COMMENT
, the current model does not allow to use it yet. But seems fine by me for now.
This adds the
type
attribute to theComment
model.