Class: Openapi3Parser::NodeFactory::Paths

Inherits:
Map
  • Object
show all
Defined in:
lib/openapi3_parser/node_factory/paths.rb

Constant Summary collapse

PATH_REGEX =
%r{
  \A
  # required prefix slash
  /
  (
    # Match a path
    ([\-;_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})*
    # Match a path template parameter
    ({([\-;_.!~*'()a-zA-Z\d:@&=+$,]|%[a-fA-F\d]{2})+})*
    # optional segment separating slash
    /?
  )*
  \Z
}x.freeze

Instance Attribute Summary

Attributes inherited from Map

#allow_extensions, #context, #data, #default, #validation, #value_factory, #value_input_type

Instance Method Summary collapse

Methods inherited from Map

#errors, #inspect, #nil_input?, #node, #raw_input, #resolved_input, #valid?

Constructor Details

#initialize(context) ⇒ Paths

Returns a new instance of Paths.


23
24
25
26
27
28
29
30
# File 'lib/openapi3_parser/node_factory/paths.rb', line 23

def initialize(context)
  factory = NodeFactory::OptionalReference.new(NodeFactory::PathItem)

  super(context,
        allow_extensions: true,
        value_factory: factory,
        validate: :validate)
end