lib/olaf/service_swagger.rb
def swagger_operations(routes)
      routes.map do |path, options, properties, action|
        verb = options[:via]
        route_name = properties[:route_name]
        return_type = properties[:return_type]

        inner_ret = {
          "httpMethod" => verb.to_s.upcase,
        }
        inner_ret["summary"] = properties[:desc] if properties[:desc]
        inner_ret["nickname"] = camel_case(route_name) if route_name
        inner_ret["responseClass"] = swagger_type_convert(return_type) if return_type
        inner_ret["parameters"] = swagger_params(properties[:param]) if properties[:param]
        inner_ret["errorResponses"] = swagger_errors(properties[:errors] || [])
        inner_ret["notes"] = properties["notes"] || ""

        inner_ret
      end
    end
# snake_case and camel_case implementations stolen from extlib 0.9.15
snake_case and camel_case implementations stolen from extlib 0.9.15
snake_case and camel_case implementations stolen from extlib 0 . 9 . 15
def swagger_operations(routes)
      routes.map do |path, options, properties, action|
        verb = options[:via]
        route_name = properties[:route_name]
        return_type = properties[:return_type]
        inner_ret = {
          "httpMethod" => verb.to_s.upcase,
        }
        inner_ret["summary"] = properties[:desc] if properties[:desc]
        inner_ret["nickname"] = camel_case(route_name) if route_name
        inner_ret["responseClass"] = swagger_type_convert(return_type) if return_type
        inner_ret["parameters"] = swagger_params(properties[:param]) if properties[:param]
        inner_ret["errorResponses"] = swagger_errors(properties[:errors] || [])
        inner_ret["notes"] = properties["notes"] || ""
        inner_ret
      end
    end
def swagger_operations ( routes ) routes . map do | path , options , properties , action | verb = options [ :via ] route_name = properties [ :route_name ] return_type = properties [ :return_type ] inner_ret = { "httpMethod" => verb . to_s . upcase , } inner_ret [ "summary" ] = properties [ :desc ] if properties [ :desc ] inner_ret [ "nickname" ] = camel_case ( route_name ) if route_name inner_ret [ "responseClass" ] = swagger_type_convert ( return_type ) if return_type inner_ret [ "parameters" ] = swagger_params ( properties [ :param ] ) if properties [ :param ] inner_ret [ "errorResponses" ] = swagger_errors ( properties [ :errors ] || [ ] ) inner_ret [ "notes" ] = properties [ "notes" ] || "" inner_ret end end
snake_case and camel_case implementations stolen from extlib 0.9.15
snake_case and camel_case implementations stolen from extlib 0 . 9 . 15
routes