Class: PostSecurityAPIValidationBody

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/schemas.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_dynamic!(d) ⇒ Object



27140
27141
27142
27143
27144
27145
# File 'lib/schemas.rb', line 27140

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    schema: d["schema"] ? PostSecurityAPIValidationBodySchema.from_dynamic!(d["schema"]) : nil,
  )
end

.from_json!(json) ⇒ Object



27147
27148
27149
# File 'lib/schemas.rb', line 27147

def self.from_json!(json)
  from_dynamic!(JSON.parse(json))
end

Instance Method Details

#to_dynamicObject



27151
27152
27153
27154
27155
# File 'lib/schemas.rb', line 27151

def to_dynamic
  {
    "schema" => schema&.to_dynamic,
  }
end

#to_json(options = nil) ⇒ Object



27157
27158
27159
# File 'lib/schemas.rb', line 27157

def to_json(options = nil)
  JSON.generate(to_dynamic, options)
end