Closed SamuelMeza closed 6 years ago
Hello,
if you looked at implementation of type resolver there is no Json type defined. Maybe all undefined values should be approached like Object? Will that be convenient for you?
Hey,
I am actually converting the json object to a string and limiting the variables returned by the rest api to get around this situation, but I do wonder if this should be supported somehow as the usage of json objects when saving data seems to be a thing on camunda, I will take a look later and see if I can suggest something :)
I'm seeing the same thing, and would think that if you can't do anything else to it then returning an object would be preferable to the exception that is returned today. Otherwise, if you can see that it's JSON, returning it as a string would be nice too.
@jlucansky The "Json" type comes from the Spin plugin: https://github.com/camunda/camunda-bpm-platform/blob/master/engine-plugins/spin-plugin/src/main/java/org/camunda/spin/plugin/variable/type/JsonValueType.java
We encountered this very issue before, I've fixed it here: https://github.com/flyingpie/Camunda.Api.Client/pull/2/files
Want a PR?
Thank you PR will be awesome
@jlucansky Here you go https://github.com/jlucansky/Camunda.Api.Client/pull/25
No pressure, take a look whenever you have the time :)
Merged. You have now option to specify deserializeValue = false
when reading variables.
When working with embedded javascript in camunda, it seems that the best way to deal with strings that represent json objects is to convert them with the spin method "S()" and storing them in the format returned by this method, in the camunda rest api this types of objects are returned with a type of "Json" like in the example:
This representation will result in an exception when trying to pull an external task using the library as it cannot find a type of Json, I believe this is a bug as the library should be able to figure out that the Json type served by camunda is basically a string.
Exception bellow.