Module: Jimmy
- Extended by:
- Macros
- Defined in:
- lib/jimmy.rb,
lib/jimmy/error.rb,
lib/jimmy/index.rb,
lib/jimmy/macros.rb,
lib/jimmy/schema.rb,
lib/jimmy/version.rb,
lib/jimmy/file_map.rb,
lib/jimmy/json/uri.rb,
lib/jimmy/json/hash.rb,
lib/jimmy/json/array.rb,
lib/jimmy/declaration.rb,
lib/jimmy/schema/json.rb,
lib/jimmy/json/pointer.rb,
lib/jimmy/loaders/base.rb,
lib/jimmy/loaders/json.rb,
lib/jimmy/loaders/ruby.rb,
lib/jimmy/schema/array.rb,
lib/jimmy/schema/number.rb,
lib/jimmy/schema/object.rb,
lib/jimmy/schema/string.rb,
lib/jimmy/schema/casting.rb,
lib/jimmy/json/collection.rb,
lib/jimmy/schema_with_uri.rb,
lib/jimmy/schemer_factory.rb,
lib/jimmy/schema/operators.rb,
lib/jimmy/declaration/types.rb,
lib/jimmy/schema/conditions.rb,
lib/jimmy/declaration/number.rb,
lib/jimmy/declaration/object.rb,
lib/jimmy/declaration/string.rb,
lib/jimmy/declaration/casting.rb,
lib/jimmy/declaration/assertion.rb,
lib/jimmy/declaration/composites.rb,
lib/jimmy/declaration/conditions.rb
Overview
Jimmy makes declaring and validating against JSON schemas a piece of cake.
Defined Under Namespace
Modules: Declaration, Json, Loaders, Macros Classes: Error, FileMap, Index, Schema, SchemaWithURI, SchemerFactory
Constant Summary collapse
- ROOT =
Pathname(__dir__).parent
- VERSION =
'2.1.0'
Constants included from Declaration
Declaration::BOOLEANS, Declaration::FORMATS, Declaration::SIMPLE_TYPES
Class Method Summary collapse
-
.Schema(schema) ⇒ Schema
Passes
schema
toSchema.new
, unless it is already a Schema, in which case it is returned unmodified. - .schemer(*args, **opts) ⇒ Object
Methods included from Macros
Methods included from Declaration
#all_of, #any_of, #array, #boolean, #const, #date, #date_time, #default, #define, #definitions, #description, #email, #enum, #examples, #hostname, #idn_email, #idn_hostname, #if, #integer, #ipv4, #ipv6, #iri, #iri_reference, #json_pointer, #multiple_of, #not, #null, #number, #object, #one_of, #pattern, #range, #read_only, #regex, #relative_json_pointer, #string, #struct, #time, #title, #type, #uri, #uri_reference, #uri_template, #write_only
Class Method Details
.Schema(schema) ⇒ Schema
Passes schema
to Schema.new
, unless it is already a Schema, in which case it is returned unmodified.
25 26 27 |
# File 'lib/jimmy.rb', line 25 def self.Schema(schema) # rubocop:disable Naming/MethodName schema.is_a?(Schema) ? schema : Schema.new(schema) end |
.schemer(*args, **opts) ⇒ Object
17 18 19 |
# File 'lib/jimmy.rb', line 17 def self.schemer(*args, **opts) SchemerFactory.new(*args, **opts).schemer end |