Class: OdataDuty::OAS2::IndividualGetPath
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- OdataDuty::OAS2::IndividualGetPath
- Defined in:
- lib/odata_duty/oas2/individual_get_path.rb
Instance Method Summary collapse
- #oas2_parameters ⇒ Object
- #oas2_responses ⇒ Object
- #summary_and_description ⇒ Object
- #to_oas2 ⇒ Object
Instance Method Details
#oas2_parameters ⇒ Object
20 21 22 23 24 25 26 27 28 29 |
# File 'lib/odata_duty/oas2/individual_get_path.rb', line 20 def oas2_parameters [ { 'name' => 'id', 'in' => 'path', 'required' => true, 'type' => entity_type.integer_property_ref? ? 'integer' : 'string' } ] end |
#oas2_responses ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/odata_duty/oas2/individual_get_path.rb', line 31 def oas2_responses { '200' => { 'description' => 'Individual Response', 'schema' => { '$ref' => "#/definitions/#{entity_type_name}" } }, 'default' => DEFAULT_ERROR_RESPONSE } end |
#summary_and_description ⇒ Object
14 15 16 17 18 |
# File 'lib/odata_duty/oas2/individual_get_path.rb', line 14 def summary_and_description return {} unless description { 'summary' => OperationVerbs.get(name), 'description' => description } end |
#to_oas2 ⇒ Object
4 5 6 7 8 9 10 11 12 |
# File 'lib/odata_duty/oas2/individual_get_path.rb', line 4 def to_oas2 { 'operationId' => "GetIndividual#{name}ById" }.merge(summary_and_description).merge( 'produces' => ['application/json'], 'parameters' => oas2_parameters, 'responses' => oas2_responses ) end |