Skip to content

URI example does not abide by the :path option #151

Description

@blanquer
class Test < Attributor::Struct
  attributes do
    attribute :href, Attributor::URI, path: %r{/foo/\d+}
  end
end

puts Test.example.dump
 => {:href=>"http://example.com/hydrocoralline/804302141"}

Although, it would correctly validate against it:

t = Test.load( {href: "/bar/123"} )
puts t.validate
=> $.href value (/bar/123) does not match path (/\/foo\/\d+/)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions