Class: GrapeSwagger::DocMethods::ParseParams
- Inherits:
-
Object
- Object
- GrapeSwagger::DocMethods::ParseParams
- Defined in:
- lib/grape-swagger/doc_methods/parse_params.rb
Class Method Summary collapse
-
.call(param, settings, path, route, definitions, consumes) ⇒ Object
rubocop:disable Metrics/ParameterLists.
Class Method Details
.call(param, settings, path, route, definitions, consumes) ⇒ Object
rubocop:disable Metrics/ParameterLists
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/grape-swagger/doc_methods/parse_params.rb', line 7 def call(param, settings, path, route, definitions, consumes) # rubocop:disable Metrics/ParameterLists method = route.request_method additional_documentation = settings.fetch(:documentation, {}) settings.merge!(additional_documentation) data_type = DataType.call(settings) value_type = settings.merge(data_type: data_type, path: path, param_name: param, method: method) # required properties @parsed_param = { in: param_type(value_type, consumes), name: settings[:full_name] || param } # optional properties document_description(settings) document_type_and_format(settings, data_type) document_array_param(value_type, definitions) if value_type[:is_array] document_default_value(settings) unless value_type[:is_array] document_range_values(settings) unless value_type[:is_array] document_required(settings) document_length_limits(value_type) document_additional_properties(definitions, settings) unless value_type[:is_array] document_add_extensions(settings) document_example(settings) @parsed_param end |