I am trying to build a REST module to make some updates to JIRA issues. My requirement is to read a user submitted json file inside my jira plugin using the rest module. I am not sure if there is any inbuilt class I can use as I tried to read using the request.getReader() and I am getting exception.
I know 2 ways to do it:
1. If you pass the json as a string then you can read it with the Gson library. There is usually a dependency for Gson library by default.
You can create necessary classes, which represent the structure for you Json, and then deserialize the json string into the classes
2. Or you can pass the class, which represents the json structure, to the rest endpoint as a parameter and JSON will be deserialized automatically to the class.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.