def dump
all_parameters = ParameterObject.process_parameters(action)
all_tags = tags + action.traits
h = {
summary: action.name.to_s,
operationId: id,
responses: ResponsesObject.new(responses: action.responses).dump
}
api_info = ApiDefinition.instance.infos[action.endpoint_definition.version]
if (version_with = api_info.version_with)
all_parameters.push('$ref' => '#/components/parameters/ApiVersionHeader') if version_with.include?(:header)
all_parameters.push('$ref' => '#/components/parameters/ApiVersionParam') if version_with.include?(:params)
end
h[:description] = action.description if action.description
h[:tags] = all_tags.uniq unless all_tags.empty?
h[:parameters] = all_parameters unless all_parameters.empty?
h[:requestBody] = RequestBodyObject.new(attribute: action.payload).dump if action.payload
h
end