Libraries: JSON Serialization and Deserialization (native MQL) - page 4

 
Manuel Alejandro Cercos Perez #:

Remove the parenthesis

fixed, thanks

I am attaching fixed code here

Files:
JAson_1.13.mqh  45 kb
 

This library causes ERROR and i confirmed it

ERR_WRONG_STRING_PARAMETER
 
5040
 
Damaged parameter of string type
 

my code

CJAVal  jv;
string text="abc";

jv.Deserialize(text);

Any idea how to fix it?

It only causes when i desearilize any string

 

If the string value does contain ';' character then Deserialize fails!

array out of range in 'JAson.mqh' (205,13)

 
Dmitry Zhakov #:

If the string value does contain ';' character then Deserialize fails!


Everything works. I found issue on my side.

 
Than you . I am sending POST WebRequests (http) from MT5 (MQL5) to Chat GPT-4-o-mini API (openai.com) . OpenAI receives JSON data . MQL does not support JSON . So had to covert to string, then convert string to Char[] array, to insert as postData into the WebRequest . I am using your Library, I'll let you know how I get on
 
Philip Kym Sang Nelson #:
Than you . I am sending POST WebRequests (http) from MT5 (MQL5) to Chat GPT-4-o-mini API (openai.com) . OpenAI receives JSON data . MQL does not support JSON . So had to covert to string, then convert string to Char[] array, to insert as postData into the WebRequest . I am using your Library, I'll let you know how I get on

That is awesome
I was thinking the same to feed my ML with response from ChatGPT.
Mind sharing how do you did it? What are the challenges?

Thanks!

 
It works perfectly Kudos :) Y'll go and check my post on how to use CJVAL class to parse json data  Extracting Specific Data from JSON Responses in MetaTrader 5
Trading blogs and financial markets analysis
Trading blogs and financial markets analysis
  • www.mql5.com
Read blogs to find the latest news on various topics from all over the world — rumors about companies, country and industry reports, market analysis, latest developments in speculative trading and more. Start your own blog to share new ideas and trading achievements with the members of MQL5.community. Post interesting images and videos, enjoy unlimited possibilities!
 

Hi, is there any way to:

- Set the value of a key to null 

- Set the value of a key to {} (empty object) 

It seems that those values won't get correctly represented if you try to set them.

Thanks for any reply