Class: Apia::OpenApi::Objects::Response

Inherits:
Object
  • Object
show all
Includes:
Helpers
Defined in:
lib/apia/open_api/objects/response.rb

Instance Method Summary collapse

Methods included from Helpers

#add_to_components_schemas, #convert_type_to_open_api_data_type, #formatted_description, #generate_array_schema, #generate_id_from_definition, #generate_scalar_schema, #generate_schema_ref

Constructor Details

#initialize(spec:, path_ids:, route:, route_spec:, api_authenticator:) ⇒ Response

Returns a new instance of Response.



31
32
33
34
35
36
37
38
39
40
# File 'lib/apia/open_api/objects/response.rb', line 31

def initialize(spec:, path_ids:, route:, route_spec:, api_authenticator:)
  @spec = spec
  @path_ids = path_ids
  @route = route
  @endpoint = route.endpoint
  @route_spec = route_spec
  @api_authenticator = api_authenticator
  @http_status = @endpoint.definition.http_status
  @response_type = @endpoint.definition.response_type
end

Instance Method Details

#add_to_specObject



42
43
44
45
# File 'lib/apia/open_api/objects/response.rb', line 42

def add_to_spec
  add_sucessful_response_schema
  add_error_response_schemas
end