Unable to print data in JSON Format

I’m interfacing BMP-180 sensor with Arduino UNO and sending the data to NodeMCU through Serial Communication. Now, I want to send the data in JSON Format from Arduino UNO. For that I’ve used ArduinoJson Library V6.

The expected output is somewhere like this:

{

“Temperature”:“25.72”,
“Pressure”: “917.69”
}

But, with the below code in Arduino UNO Serial Monitor, I’m getting output like this:

05:48:00.904 → Testing JSON Format
05:48:00.904 → {“Temperature”:25.90262,“Pressure”:917.7398}

which isn’t the JSON format I’m expecting.

Arduino UNO Code:

void bmp_Send_Sensor_Data()
{

   StaticJsonDocument<256> testDocument;
   
  //testDocument["Type"] = "Temperature";
  testDocument["Temperature"] = T;
  //testDocument["Type"] = "Pressure";
  testDocument["Pressure"] = P;
 
  char buffer[256];
 
  serializeJson(testDocument, buffer);

  Serial.println("Testing JSON Format");
  Serial.println(buffer);
  s.print(buffer);
  delay(2500); 
    
}

Can you please help me understand where I’m going wrong and how can I rectify this?

Use serializeJsonPretty(testDocument, buffer); rather than serializeJson(testDocument, buffer);

Reference: serializeJsonPretty() | ArduinoJson 6

giova014:
Use serializeJsonPretty(testDocument, buffer); rather than serializeJson(testDocument, buffer);

Reference: serializeJsonPretty() | ArduinoJson 6

Thanks!!