[GH-ISSUE #1548] Provide methods to validate custom parameters #1321

Open
opened 2026-02-28 01:29:35 +03:00 by kerem · 0 comments
Owner

Originally created by @jonasbjurel on GitHub (Jan 13, 2023).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1548

Basic Infos

A very nice library - Kudos!
Feature request.
I would propose a way to feed-back customer parameters validation errors. I think the validation should be performed by the application in the setPreSaveConfigCallback(..) callback. The application should have the opportunity to feed-back any custom parameter validation failure which would result in a configmanger GUI error message guiding where the validation failed, and prohibit it to save any of the other configuration - ensuring atomic validation and save:
A very naive thought on the implementation:

void myPreSaveConfigCb(){
if (setMqttUri(mqttServerUriParam.getValue()){ //returns true/or positive if mqttServerUriParam.getValue() is not a valid URI string conventions
mqttServerUriParam.validationError("MQTT URI validation error, %s is not a valid URI" CR, mqttServerUriParam.getValue())
}

Hardware

WiFimanager Branch/Release: Master

Esp8266/Esp32: ESP32

Hardware: ESP32 Wrover

Core Version: 2.4.0, staging

Description

See above

Settings in IDE

Additional libraries:

Sketch

Not an error - but a feature request - See proposal above

Debug Messages

Not an error - but a feature request.

Originally created by @jonasbjurel on GitHub (Jan 13, 2023). Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/1548 ### Basic Infos A very nice library - Kudos! Feature request. I would propose a way to feed-back customer parameters validation errors. I think the validation should be performed by the application in the setPreSaveConfigCallback(..) callback. The application should have the opportunity to feed-back any custom parameter validation failure which would result in a configmanger GUI error message guiding where the validation failed, and prohibit it to save any of the other configuration - ensuring atomic validation and save: A very naive thought on the implementation: void myPreSaveConfigCb(){ if (setMqttUri(mqttServerUriParam.getValue()){ //returns true/or positive if mqttServerUriParam.getValue() is not a valid URI string conventions mqttServerUriParam.validationError("MQTT URI validation error, %s is not a valid URI" CR, mqttServerUriParam.getValue()) } #### Hardware WiFimanager Branch/Release: Master Esp8266/Esp32: ESP32 Hardware: ESP32 Wrover Core Version: 2.4.0, staging ### Description See above ### Settings in IDE - Additional libraries: - ### Sketch Not an error - but a feature request - See proposal above ### Debug Messages Not an error - but a feature request.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/WiFiManager#1321
No description provided.