class Swagger::Blocks::Nodes::PathNode

v2.0: github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#path-item-object

Constants

OPERATION_TYPES

Public Instance Methods

operation(op, inline_keys = nil, &block) click to toggle source

TODO support ^x- Vendor Extensions

# File lib/swagger/blocks/nodes/path_node.rb, line 9
def operation(op, inline_keys = nil, &block)
  op = op.to_sym
  raise ArgumentError.new("#{name} not in #{OPERATION_TYPES}") if !OPERATION_TYPES.include?(op)
  self.data[op] = Swagger::Blocks::Nodes::OperationNode.call(version: version, inline_keys: inline_keys, &block)
end
parameter(inline_keys = nil, &block) click to toggle source
# File lib/swagger/blocks/nodes/path_node.rb, line 15
def parameter(inline_keys = nil, &block)
  inline_keys = {'$ref' => "#/parameters/#{inline_keys}"} if inline_keys.is_a?(Symbol)

  self.data[:parameters] ||= []
  self.data[:parameters] << Swagger::Blocks::Nodes::ParameterNode.call(version: version, inline_keys: inline_keys, &block)
end
server(inline_keys = nil, &block) click to toggle source
# File lib/swagger/blocks/nodes/path_node.rb, line 22
def server(inline_keys = nil, &block)
  raise NotSupportedError unless is_openapi_3_0?
  self.data[:servers] ||= []
  self.data[:servers] << Swagger::Blocks::Nodes::ServerNode.call(version: version, inline_keys: inline_keys, &block)
end