• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

notEthan / jsi / 5544120761

pending completion
5544120761

push

github

web-flow
Bump coverallsapp/github-action from 2.1.2 to 2.2.1

Bumps [coverallsapp/github-action](https://github.com/coverallsapp/github-action) from 2.1.2 to 2.2.1.
- [Release notes](https://github.com/coverallsapp/github-action/releases)
- [Commits](https://github.com/coverallsapp/github-action/compare/v2.1.2...v2.2.1)

---
updated-dependencies:
- dependency-name: coverallsapp/github-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

4957 of 5058 relevant lines covered (98.0%)

282446.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

89.29
/lib/jsi/schema/validation/array.rb
1
# frozen_string_literal: true
2

3
module JSI
42✔
4
  module Schema::Validation::ArrayLength
42✔
5
    # @private
6
    def internal_validate_maxItems(result_builder)
42✔
7
      if keyword?('maxItems')
550,006✔
8
        value = schema_content['maxItems']
588✔
9
        # The value of this keyword MUST be a non-negative integer.
10
        if internal_integer?(value) && value >= 0
588✔
11
          if result_builder.instance.respond_to?(:to_ary)
588✔
12
            # An array instance is valid against "maxItems" if its size is less than, or equal to, the value of this keyword.
13
            result_builder.validate(
504✔
14
              result_builder.instance.to_ary.size <= value,
70✔
15
              'instance array size is greater than `maxItems` value',
16
              keyword: 'maxItems',
17
            )
18
          end
19
        else
20
          result_builder.schema_error('`maxItems` is not a non-negative integer', 'maxItems')
×
21
        end
22
      end
23
    end
24

25
    # @private
26
    def internal_validate_minItems(result_builder)
42✔
27
      if keyword?('minItems')
549,922✔
28
        value = schema_content['minItems']
67,508✔
29
        # The value of this keyword MUST be a non-negative integer.
30
        if internal_integer?(value) && value >= 0
67,508✔
31
          if result_builder.instance.respond_to?(:to_ary)
67,508✔
32
            # An array instance is valid against "minItems" if its size is greater than, or equal to, the value of this keyword.
33
            result_builder.validate(
26,258✔
34
              result_builder.instance.to_ary.size >= value,
3,746✔
35
              'instance array size is less than `minItems` value',
36
              keyword: 'minItems',
37
            )
38
          end
39
        else
40
          result_builder.schema_error('`minItems` is not a non-negative integer', 'minItems')
×
41
        end
42
      end
43
    end
44
  end
45
  module Schema::Validation::UniqueItems
42✔
46
    # @private
47
    def internal_validate_uniqueItems(result_builder)
42✔
48
      if keyword?('uniqueItems')
549,796✔
49
        value = schema_content['uniqueItems']
46,052✔
50
        # The value of this keyword MUST be a boolean.
51
        if value == false
46,052✔
52
          # If this keyword has boolean value false, the instance validates successfully.
53
          # (noop)
54
        elsif value == true
42,854✔
55
          if result_builder.instance.respond_to?(:to_ary)
42,860✔
56
            # If it has boolean value true, the instance validates successfully if all of its elements are unique.
57
            result_builder.validate(
6,832✔
58
              result_builder.instance.uniq.size == result_builder.instance.size,
970✔
59
              "instance array items' uniqueness does not match `uniqueItems` value",
60
              keyword: 'uniqueItems',
61
            )
62
          end
63
        else
64
          result_builder.schema_error('`uniqueItems` is not a boolean', 'uniqueItems')
×
65
        end
66
      end
67
    end
68
  end
69
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc