Class: Scorpio::OpenAPI::V2::Operation

Inherits:
Object
  • Object
show all
Defined in:
lib/scorpio/openapi.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#http_methodObject

Returns the value of attribute http_method.



142
143
144
# File 'lib/scorpio/openapi.rb', line 142

def http_method
  @http_method
end

#pathObject

Returns the value of attribute path.



141
142
143
# File 'lib/scorpio/openapi.rb', line 141

def path
  @path
end

Instance Method Details

#body_parameterObject

there should only be one body parameter; this returns it



145
146
147
148
149
# File 'lib/scorpio/openapi.rb', line 145

def body_parameter
  (parameters || []).detect do |parameter|
    parameter['in'] == 'body'
  end
end

#request_schemaObject



151
152
153
154
155
# File 'lib/scorpio/openapi.rb', line 151

def request_schema
  if body_parameter && body_parameter['schema']
    Scorpio::Schema.new(body_parameter['schema'])
  end
end