Re:Show HN: Verify JSON using minimal schema
by eventreduce on Thursday April 16, 2020 @06:11AM
(#22887847)
Yes, reading the docs explains what these keywords mean. But by just looking at the schema it is impossible to understand what that is. And if you check the definition of clean code which is something like "intuitive understandable" then it comes clear that this is not clean.
Re:Show HN: Verify JSON using minimal schema
by philliphaydon on Thursday April 16, 2020 @06:15AM
(#22887876)
Ah I see where you’re coming from. Good point.
Re:Show HN: Verify JSON using minimal schema
by catlifeonmars on Thursday April 16, 2020 @07:53AM
(#22888449)
The “!” for optional is the only thing that confused me. Why not “?” for optional?
Re:Show HN: Verify JSON using minimal schema
by yusufnb on Thursday April 16, 2020 @11:50AM
(#22890623)
Updated to ? in 1.0.3
Re:Show HN: Verify JSON using minimal schema
by philliphaydon on Friday April 17, 2020 @10:44AM
(#22899362)
Nice that makes more sense!
lat = custom validator
b = shorthand for boolean (as is s for string)
! = optional
So for me reading the whole example its very easy to understand and digest.