You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@answer.apache.org by "Dinesht04 (via GitHub)" <gi...@apache.org> on 2025/10/27 12:42:06 UTC

[I] Better Validation Error Messages for Front-End [answer]

Dinesht04 opened a new issue, #1409:
URL: https://github.com/apache/answer/issues/1409

   ## Is your enhancement request related to a problem?
   No, not a problem. But I think it is a required enhancement.
   When the validation of an input fails in the back-end. The error message includes the 'key' of the value.
   For Eg: For Minimum Question Body Length, the error message includes "min_content"
   Many other examples in the picture linked below
   
   <img width="520" height="507" alt="Image" src="https://github.com/user-attachments/assets/7e6f63ba-1395-4d97-a9c1-f9e483ebf3f6" />
   
   ## Describe the solution you'd like
   
   I checked into this and validator library sends the message directly.
   Since the key_name is necessary for debugging in back-end, maybe we can add a utility function in the front-end where it replaces the key of the value with the label for the field. 
   
   The draft vision for the function that I have right now is :-
   The first word for every error message contains the key name. So we extract the first word, small case the first letter, then match it for it's label in the translations files.  
   
   ## Describe alternatives you've considered
   
   An easier approach would be to just remove the first word from the error message since the placement of the error message gives enough context about which field is failing the validation and the keys that we are rendering right now might as well be redundant.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For additional commands, e-mail: issues-help@answer.apache.org


Re: [I] Better Validation Error Messages for Front-End [answer]

Posted by "fenbox (via GitHub)" <gi...@apache.org>.
fenbox commented on issue #1409:
URL: https://github.com/apache/answer/issues/1409#issuecomment-3459322949

   `<input type="number">` can also set ["min" and "max" value](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/number).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For additional commands, e-mail: issues-help@answer.apache.org


Re: [I] Better Validation Error Messages for Front-End [answer]

Posted by "LinkinStars (via GitHub)" <gi...@apache.org>.
LinkinStars commented on issue #1409:
URL: https://github.com/apache/answer/issues/1409#issuecomment-3454215283

   @Dinesht04 Thank you for your feedback. This issue arises due to a lack of translation. In fact, adding the corresponding field's translation to the relevant language file will resolve the matter.
   
   For example
   
   <img width="564" height="484" alt="Image" src="https://github.com/user-attachments/assets/c539e40e-1b1c-45f0-b8b9-9a653f7c67fa" />
   
   <img width="920" height="788" alt="Image" src="https://github.com/user-attachments/assets/832d1f63-b8ce-4ec1-b552-91638e828468" />


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For additional commands, e-mail: issues-help@answer.apache.org


Re: [I] Better Validation Error Messages for Front-End [answer]

Posted by "Dinesht04 (via GitHub)" <gi...@apache.org>.
Dinesht04 commented on issue #1409:
URL: https://github.com/apache/answer/issues/1409#issuecomment-3455220597

   Ohh got it! Thanks!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For additional commands, e-mail: issues-help@answer.apache.org


Re: [I] Better Validation Error Messages for Front-End [answer]

Posted by "fenbox (via GitHub)" <gi...@apache.org>.
fenbox closed issue #1409: Better Validation Error Messages for Front-End
URL: https://github.com/apache/answer/issues/1409


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@answer.apache.org
For additional commands, e-mail: issues-help@answer.apache.org