Hello, I'm trying to set a config (StaticJsonDocument) from a "load" method and later get that data from a different function. It's almost like shown here
he function deserializeJson() parses a JSON input and puts the result in a JsonDocument.
For a read-only input, it duplicates the strings in the input document. This duplication consumes additional space in the JsonDocument.
For a writeable input, it stores pointers to the strings in the input buffer. This is the zero-copy mode.
here you have a writeable buffer, so it's copy mode but the buffer goes out of scope and is released at the end of load(). You need to trick the compiler into calling the right function, so probably if you cast to const char* then the data should be duplicated into your doc.