kgiszczak / shale

Shale is a Ruby object mapper and serializer for JSON, YAML, TOML, CSV and XML. It allows you to parse JSON, YAML, TOML, CSV and XML data and convert it into Ruby data structures, as well as serialize data structures into JSON, YAML, TOML, CSV or XML.
https://shalerb.org/
MIT License
618 stars 19 forks source link

Fix Mapper.attribute's type param documentation #39

Closed TastyPi closed 1 month ago

TastyPi commented 1 month ago

The type parameter is expected to be a class that extends Shale::Type::Value, not an instance. This corrects that.

Without this fix, tools that use these type warnings for warnings (in my case RubyMine) complain the type is incorrect when used correctly:

image

This change corrects the error:

image

While still giving warnings for passing wrong values:

image