Module: PairKit::JsonSchema::Dsl::ObjectDsl

Includes:
CommonPartialDsl
Defined in:
lib/pair_kit/json_schema/dsl/nodes/object_dsl.rb

Overview

Instance Method Summary collapse

Methods included from NullPartialDsl

#null

Methods included from StructuralPartialDsl

#_else, #_if, #_not, #_then, #all_of, #any_of, #one_of

Methods included from EnumPartialDsl

#enum

Methods included from ConstPartialDsl

#const

Methods included from MetaDataPartialDsl

#default, #deprecated, #description, #example, #read_only, #readable, #title, #writable, #write_only

Methods included from CorePartialDsl

#anchor, #comment, #define, #dynamic_anchor, #dynamic_ref, #id, #ref, #schema, #vocabulary

Instance Method Details

#additional_propertiesObject



19
20
21
# File 'lib/pair_kit/json_schema/dsl/nodes/object_dsl.rb', line 19

def additional_properties

end

#dependency(name, *dependent) ⇒ Object



35
36
37
# File 'lib/pair_kit/json_schema/dsl/nodes/object_dsl.rb', line 35

def dependency(name, *dependent)
  @subject['dependentRequired', {}][name, []] += dependent
end

#dependent_schemasObject



27
28
29
# File 'lib/pair_kit/json_schema/dsl/nodes/object_dsl.rb', line 27

def dependent_schemas

end

#max_props(val) ⇒ Object



39
40
41
# File 'lib/pair_kit/json_schema/dsl/nodes/object_dsl.rb', line 39

def max_props(val)
  @subject['maxLength'] = val
end

#min_props(val) ⇒ Object



31
32
33
# File 'lib/pair_kit/json_schema/dsl/nodes/object_dsl.rb', line 31

def min_props(val)
  @subject['minLength'] = val
end

#pattern_propsObject



15
16
17
# File 'lib/pair_kit/json_schema/dsl/nodes/object_dsl.rb', line 15

def pattern_props

end

#prop(name, &block) ⇒ Object



10
11
12
13
# File 'lib/pair_kit/json_schema/dsl/nodes/object_dsl.rb', line 10

def prop(name, &block)
  @subject['properties', {}][name] = {}
  @dsl.call(@subject, builder: :property, name: name, &block)
end

#prop_namesObject



23
24
25
# File 'lib/pair_kit/json_schema/dsl/nodes/object_dsl.rb', line 23

def prop_names

end

#required(*props) ⇒ Object



43
44
45
# File 'lib/pair_kit/json_schema/dsl/nodes/object_dsl.rb', line 43

def required(*props)
  @subject['required', []] += props
end