class Openapi3Parser::NodeFactory::Response
Private Instance Methods
build_object(data, context)
click to toggle source
# File lib/openapi3_parser/node_factory/response.rb, line 16 def build_object(data, context) Node::Response.new(data, context) end
content_factory(context)
click to toggle source
# File lib/openapi3_parser/node_factory/response.rb, line 25 def content_factory(context) NodeFactory::Map.new( context, validate: method(:validate_content), value_factory: NodeFactory::MediaType ) end
headers_factory(context)
click to toggle source
# File lib/openapi3_parser/node_factory/response.rb, line 20 def headers_factory(context) factory = NodeFactory::OptionalReference.new(NodeFactory::Header) NodeFactory::Map.new(context, value_factory: factory) end
links_factory(context)
click to toggle source
# File lib/openapi3_parser/node_factory/response.rb, line 33 def links_factory(context) factory = NodeFactory::OptionalReference.new(NodeFactory::Link) NodeFactory::Map.new( context, validate: Validation::InputValidator.new(Validators::ComponentKeys), value_factory: factory ) end
validate_content(validatable)
click to toggle source
# File lib/openapi3_parser/node_factory/response.rb, line 42 def validate_content(validatable) validatable.input.each_key do |key| message = Validators::MediaType.call(key) next unless message validatable.add_error(message, Context.next_field(validatable.context, key)) end end