Leading zeros in JSON editor invalidates the input silently without errors

We had this issue where edits to JSON data were not saving to the DB consistently. After investigating this for a while, I found the following behaviour that could be improved.

  1. Entering a number in the JSON with a leading zero invalidates the entire JSON eg. { "day" 02 }
  2. When the above happens, there is no visual clue in the editor to indicate that leading zeros are not supported. The only way to see this is in the JSON editor state which will have valid: false. It will be great to indicate this in the UI or even better, just handle leading zeros.
  3. The JSON editor validity does not impact the form validation rules. I have the submit button set to disabled when the form is invalid but it appears JSON editor doesn't impact the state and I have to do something like {{ trainingForm.invalid || !responseJSON.valid }}.

Thanks for reporting, @Kingsley_Ochu !

1 Like