Sha256: b6cda3a2e4fdf4abb8e3f2328b7ea265d8ed1b7c134da3cfcb53cdf5650c6f3a

Contents?: true

Size: 559 Bytes

Versions: 2

Compression:

Stored size: 559 Bytes

Contents

require 'api-tester/reporter/missing_response_field_report'

module ApiTester
  class UnusedFields
    def self.go contract
      reports = []

      contract.endpoints.each do |endpoint|
        endpoint.methods.each do |method|
          method.expected_response.body.each do |field|
            if field.is_seen == 0
              reports << MissingResponseFieldReport.new(endpoint.url, method.verb, field.name, "UnusedFieldsModule")
            end
          end
        end
      end

      reports
    end

    def self.order
      99
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
api-tester-1.0.0 lib/api-tester/modules/unused_fields.rb
api-tester-0.3.1 lib/api-tester/modules/unused_fields.rb