docs: update JSON field type checks from JsonObject to String for improved validation

This commit is contained in:
2025-02-21 17:11:48 +01:00
parent 4992f5f433
commit 38b68aecfc
3 changed files with 11 additions and 11 deletions

View File

@ -49,7 +49,7 @@ void onWsEvent(AsyncWebSocket *server, AsyncWebSocketClient *client, AwsEventTyp
}
else if (doc["type"] == "writeNfcTag") {
if (doc["payload"].is<JsonObject>()) {
if (doc["payload"].is<String>()) {
// Versuche NFC-Daten zu schreiben
String payloadString;
serializeJson(doc["payload"], payloadString);
@ -235,7 +235,7 @@ void setupWebserver(AsyncWebServer &server) {
html.replace("{{spoolmanUrl}}", spoolmanUrl);
JsonDocument doc;
if (loadJsonValue("/bambu_credentials.json", doc) && doc["bambu_ip"].is<JsonObject>()) {
if (loadJsonValue("/bambu_credentials.json", doc) && doc["bambu_ip"].is<String>()) {
String bambuIp = doc["bambu_ip"].as<String>();
String bambuSerial = doc["bambu_serialnr"].as<String>();
String bambuCode = doc["bambu_accesscode"].as<String>();