We ran into an interesting case today that was a little tricky to figure out. In the end it turns out we had a nil where we expected a form, causing havoc in the HTML formatter.
Yaks::Resource are quite strict and explicit in their structure. In this case it's an error on the user's side that there's a nil there, but it can be hard to debug (and works fine for most JSON formats).
So the idea would be to have a linter that can run as part of an after_map hook and that throws more descriptive messages.
Yaks.new do
after_map {|resource, _env| Yaks::Resource::Lint.call(resource) }
end
We ran into an interesting case today that was a little tricky to figure out. In the end it turns out we had a
nil
where we expected a form, causing havoc in the HTML formatter.Yaks::Resource
are quite strict and explicit in their structure. In this case it's an error on the user's side that there's a nil there, but it can be hard to debug (and works fine for most JSON formats).So the idea would be to have a linter that can run as part of an
after_map
hook and that throws more descriptive messages.