Jump to content
Sign in to follow this  
Erik Vestergaard

JsonTypeInfo in Delphi?

Recommended Posts

Hi

I am trying to write a Delphi RESTCall using JSON.

We allready have a javaclass that works.

It is using this annotation to make Jackson able to parse correctly.

@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, property = "className")


But what is the correspondent construction in Delphi?


My code:

      s := TJson.ObjectToJsonString(o90RpcCall);


The error I get is this:

<div>JSON parse error: Missing type id when trying to resolve subtype of [simple type, class java.lang.Object]: missing type id property 'className' (for POJO property 'args'); nested exception is com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Missing type id when trying to resolve subtype of [simple type, class java.lang.Object]: missing type id property 'className' (for POJO property 'args')
 at [Source: (PushbackInputStream); line: 1, column: 181] (through reference chain: o90client.generel.JSONRPCCall["args"]->java.lang.Object[][0])</div></body></html>

I guess it is because of the lack of annotation in my class
 

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×