
Security News
Researcher Exposes Zero-Day Clickjacking Vulnerabilities in Major Password Managers
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
= DeeplyValid
There are times when you just can't fake it. Maybe you're implementing an API, or interacting with a legacy system. But for whatever reason, you have complex data structures that absolutely have to be valid.
DeeplyValid lets you define a "schema" for your data structures in a nice, declarative, way.
== The Simplest Example:
class MyValidations < DeeplyValid::Base define :name, "bob" end
MyValidations[:name].valid?("bob")
MyValidations[:name].valid?("joe")
== A more realistic example
class MyValidations < DeeplyValid::Base define :person, { :id => token(32), :age => integer(1..100), :name => string(1..100), :department => { :name => any('sales', 'accounting', 'engineering'), :building => integer }, :performace_reviews => array( structure(:review) ) }
# This structure is referenced in the "person" structure
define :review, {
:author => string(1..100),
:body => string(1..1024)
}
end
MyValidations[:person].valid?({ :id => "x"*32, :age => 22, :name => "Bob Jones", :department => { :name => "sales", :building => 33 }, :performace_reviews => [ { :author => "joe", :body => "a review" }, { :author => "bill", :body => "another review" } ] })
== Note on Patches/Pull Requests
== Copyright
Copyright (c) 2010 Starr Horne. See LICENSE for details.
FAQs
Unknown package
We found that deeply_valid demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Hacker Demonstrates How Easy It Is To Steal Data From Popular Password Managers
Security News
Oxlint’s new preview brings type-aware linting powered by typescript-go, combining advanced TypeScript rules with native-speed performance.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.