Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vex.Extract not implemented for %{} #28

Closed
churcho opened this issue Jun 14, 2016 · 8 comments
Closed

Vex.Extract not implemented for %{} #28

churcho opened this issue Jun 14, 2016 · 8 comments
Assignees
Milestone

Comments

@churcho
Copy link

churcho commented Jun 14, 2016

Is it possible to simply validate a map on the fly without creating a struct with the validation definitions? I would like to validate values coming from my Plug.Con request without having to perform Vex.Validators.Presence.validate on each one of those values.

Let's assume I need to check for the existance of all these keys

%{"country" => "KE", "email" => "me@test.com", "ip" => "32.217.45.88", "password" => "######", "phone" => "567890432"}

Right now I am thinking my only option is to recursively run through it, get the keys and check for for those using Precence.validate

@djspinmonkey
Copy link
Contributor

djspinmonkey commented Sep 6, 2016

Is this still a valid issue? Looking at https://github.com/CargoSense/vex/blob/master/lib/vex/extract.ex#L24 it seems that Vex.Extract is now implemented for maps. That seems to have been added in #17 which was well before this issue was opened, so I'm a little confused.

@dkushner
Copy link

I am also having this issue with version 0.5.5.

** (Protocol.UndefinedError) protocol Vex.Extract not implemented for %{children: [%{type: "header"}, %{type: "footer"}, %{type: "body"}], options: %{}, type: "root"}

@djspinmonkey
Copy link
Contributor

djspinmonkey commented Sep 16, 2016

Ah, hm, yes, looks like that release was back in January. This issue seems to have been fixed in #17, which is slotted for the 0.6 release, which hasn't happened.

@bruce, any reason I shouldn't go ahead and cut a new 0.6 release? Relatedly, how would I go about cutting a new 0.6 release? ;-)

@dkushner
Copy link

@djspinmonkey, nice response time! Looking forward to the new release.

@bruce
Copy link
Contributor

bruce commented Sep 16, 2016

@djspinmonkey Send me the email address you have registered with hex.pm and I'll add you as a project owner; then it's just a version bump in mix.exs and a mix hex.publish away.

@djspinmonkey djspinmonkey self-assigned this Sep 16, 2016
@djspinmonkey djspinmonkey added this to the v0.6 Release milestone Sep 16, 2016
@djspinmonkey
Copy link
Contributor

It's john@djspinmonkey.com (same as on my github account, and also on my everything everywhere, so I don't mind just posting it here ;-) ).

@bruce
Copy link
Contributor

bruce commented Sep 18, 2016

@djspinmonkey DONE. 🚀

@djspinmonkey
Copy link
Contributor

Ok! v0.6.0 is pushed. I'll make some release notes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants