Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 17:03
    paul commented #32
  • 16:44
    paul commented #32
  • 10:56
    solnic commented #32
  • 10:30
    solnic commented #32
  • Dec 05 09:29

    solnic on master

    Clear exception message when an… Add gem names to plugins Merge pull request #128 from sk… (compare)

  • Dec 05 09:29
    solnic closed #128
  • Dec 05 09:29
    solnic closed #127
  • Dec 04 18:49
    micahphone starred dry-rb/dry-monads
  • Dec 04 17:43
    icy-arctic-fox starred dry-rb/dry-types
  • Dec 02 12:37
    pedrofurtado starred dry-rb/dry-view
  • Dec 02 11:59
    lenon starred dry-rb/dry-monads
  • Dec 01 11:06

    flash-gordon on declare-finalized

    (compare)

  • Dec 01 11:06

    flash-gordon on master

    Set initial value for ivar Merge pull request #131 from dr… (compare)

  • Dec 01 11:06
    flash-gordon closed #131
  • Dec 01 11:05
    flash-gordon opened #131
  • Dec 01 11:03

    flash-gordon on declare-finalized

    Set initial value for ivar (compare)

  • Nov 30 16:50
    paul commented #32
  • Nov 30 16:50
    paul synchronize #32
  • Nov 30 16:44
    paul synchronize #32
Krzysztof Wawer
@wafcio

so my opinion about dry-validation - it has freaky error format: sometime I see

errors = schema.call(email: 'jane@doe.org', age: 17).messages

puts errors.inspect
# { :age => [["age must be greater than 18"], 17] }

another time I see

errors = schema.call(email: nil, age: 19).messages

puts errors.inspect
# { :email => [["email must be filled", nil]] }

I caused that I droped dry-validation today.

Piotr Solnica
@solnic
wow what happened with the formating here?
Krzysztof Wawer
@wafcio
I have always problem with formatting in this strange style and strange new line keys
maybe I will back to dry-validation when I will have more time
Piotr Solnica
@solnic
I’m not sure what the problem is, it gives you errors
Krzysztof Wawer
@wafcio
I wanted use drop validation in API where I need return validation keys
and when I saw
[[„invalid”, nil]]
I said WHAT ???
invalid was my translation message
Piotr Solnica
@solnic
so what’s the problem?
first array includes compiled error messages, the second argument is the original input value
Krzysztof Wawer
@wafcio
and for this I must write own wrapper, and when I open README and saw that sometimes there is construction like
[[…, …], …]
I said not today
Piotr Solnica
@solnic
what is your desired format?
error messages can be compiled to anything, I just used a simple hash for now as the default but it can be literally anything, it’s a pluggable “behavior” in dry-v
Krzysztof Wawer
@wafcio
{ attribute: [error, error], attribute: [error, error]}
like it was in 0.1.0 version
Piotr Solnica
@solnic
so you don’t like the fact you’ve got original value?
Krzysztof Wawer
@wafcio
for now I have this requirement from frontend app
Piotr Solnica
@solnic
I put it there because it’s useful for cases like each rule and figuring out the index of a given value when it comes from an array
displaying these errors is still pretty simple though, not sure why it has put you off :)
errors.each { |attribute, (messages, _)| … } or something
Krzysztof Wawer
@wafcio
I don’t understand why there is two different format: { :age => [["age must be greater than 18"], 17] } and { :email => [["email must be filled", nil]] }
Piotr Solnica
@solnic
two formats?
Krzysztof Wawer
@wafcio
[[…], …] and [[…, …]]
Piotr Solnica
@solnic
oh, now THAT seems like a bug :joy:
I will try to repro and fix
Krzysztof Wawer
@wafcio
I read it from README file
maybe README is old
Piotr Solnica
@solnic
maybe I made a mistake writing readme, that’s more likely :)
Krzysztof Wawer
@wafcio
ok
Piotr Solnica
@solnic
lemme see
Krzysztof Wawer
@wafcio
so I will give chance dry-validation, again :)
Piotr Solnica
@solnic
yeah, it’s a bug, I’ll fix it and push a release
Krzysztof Wawer
@wafcio
I wanted switch to dry-validation in 0.1.0 version, but like I said some time aga in 0.1.0 we dry-validation didn’t have optional keys
ok
Piotr Solnica
@solnic
uhm, it’s pretty messed up right now, no wonder it got you confused
I’ll try to fix it later today or tomorrow
Piotr Solnica
@solnic
@wafcio I fixed that issue we talked about yesterday with error messages hash structure. it’s in master
Piotr Solnica
@solnic
good news people, "validation hints” landed on master, here’s a higher-level spec which shows current behavior, seems innocent but it’s pretty crucial - we provide all validation messages even though not all predicates are being applied (because it makes no sense). This is the very first step. Soon I’ll start experimenting with optimizations like dropping some messages when other have higher priority and expose an interface to provide your own optimization rules so that validation messages will not have redundant information.
Piotr Solnica
@solnic
dryrb/dry-validation#40
@AMHOL @kwando I can haz some feedback? ^
it’s a pretty big addition
Andy Holland
@AMHOL
:joy:
I'll take the red pill
Piotr Solnica
@solnic
haha
Hannes Nevalainen
@kwando
@solnic niceness! I'll have to use it before I can have better feedback =)
Hannes Nevalainen
@kwando
dry-validation for validating ENV on boot => friendly error messages <3