Skip to content

Commit

Permalink
Fix incorrect autogenerated difficulty enum values
Browse files Browse the repository at this point in the history
  • Loading branch information
KludgeKML committed Jul 5, 2023
1 parent 2696783 commit 9fdf788
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion docs/Issue1.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **conformance** | **String** | Conformance level (WCAG: A, AA, AAA, or Best practices: ARIA, SI) | [optional][default to 'a'] |
| **difficulty** | **String** | Difficulty rating, 1-4 | [optional][default to 'difficulty1'] |
| **difficulty** | **String** | Difficulty rating, 1-4 | [optional][default to '1'] |
| **help** | [**Help**](Help.md) | | [optional] |
| **occurrences** | **Integer** | Total number of occurrences of this issue on a site. | |
| **pages** | **Integer** | Number of pages this issue is found on | |
Expand Down
2 changes: 1 addition & 1 deletion docs/IssueOnPage.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **conformance** | **String** | Conformance level (WCAG: A, AA, AAA, or Best practices: ARIA, SI) | [optional][default to 'a'] |
| **difficulty** | **String** | Difficulty rating, 1-4 | [optional][default to 'difficulty1'] |
| **difficulty** | **String** | Difficulty rating, 1-4 | [optional][default to '1'] |
| **help** | [**Help**](Help.md) | | [optional] |
| **occurrences** | **Integer** | Total number of occurrences of this issue on a site. | |
| **rule_id** | **Integer** | Id of the check. | |
Expand Down
6 changes: 3 additions & 3 deletions lib/siteimprove_api_client/models/issue1.rb
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def initialize(attributes = {})
if attributes.key?(:'difficulty')
self.difficulty = attributes[:'difficulty']
else
self.difficulty = 'difficulty1'
self.difficulty = '1'
end

if attributes.key?(:'help')
Expand Down Expand Up @@ -165,7 +165,7 @@ def list_invalid_properties
def valid?
conformance_validator = EnumAttributeValidator.new('String', ["a", "aa", "aaa", "aria", "si"])
return false unless conformance_validator.valid?(@conformance)
difficulty_validator = EnumAttributeValidator.new('String', ["difficulty1", "difficulty2", "difficulty3", "difficulty4"])
difficulty_validator = EnumAttributeValidator.new('String', ["1", "2", "3", "4"])
return false unless difficulty_validator.valid?(@difficulty)
return false if @occurrences.nil?
return false if @pages.nil?
Expand All @@ -186,7 +186,7 @@ def conformance=(conformance)
# Custom attribute writer method checking allowed values (enum).
# @param [Object] difficulty Object to be assigned
def difficulty=(difficulty)
validator = EnumAttributeValidator.new('String', ["difficulty1", "difficulty2", "difficulty3", "difficulty4"])
validator = EnumAttributeValidator.new('String', ["1", "2", "3", "4"])
unless validator.valid?(difficulty)
fail ArgumentError, "invalid value for \"difficulty\", must be one of #{validator.allowable_values}."
end
Expand Down
6 changes: 3 additions & 3 deletions lib/siteimprove_api_client/models/issue_on_page.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def initialize(attributes = {})
if attributes.key?(:'difficulty')
self.difficulty = attributes[:'difficulty']
else
self.difficulty = 'difficulty1'
self.difficulty = '1'
end

if attributes.key?(:'help')
Expand Down Expand Up @@ -144,7 +144,7 @@ def list_invalid_properties
def valid?
conformance_validator = EnumAttributeValidator.new('String', ["a", "aa", "aaa", "aria", "si"])
return false unless conformance_validator.valid?(@conformance)
difficulty_validator = EnumAttributeValidator.new('String', ["difficulty1", "difficulty2", "difficulty3", "difficulty4"])
difficulty_validator = EnumAttributeValidator.new('String', ["1", "2", "3", "4"])
return false unless difficulty_validator.valid?(@difficulty)
return false if @occurrences.nil?
return false if @rule_id.nil?
Expand All @@ -164,7 +164,7 @@ def conformance=(conformance)
# Custom attribute writer method checking allowed values (enum).
# @param [Object] difficulty Object to be assigned
def difficulty=(difficulty)
validator = EnumAttributeValidator.new('String', ["difficulty1", "difficulty2", "difficulty3", "difficulty4"])
validator = EnumAttributeValidator.new('String', ["1", "2", "3", "4"])
unless validator.valid?(difficulty)
fail ArgumentError, "invalid value for \"difficulty\", must be one of #{validator.allowable_values}."
end
Expand Down
2 changes: 1 addition & 1 deletion spec/models/issue1_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
describe 'test attribute "difficulty"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["difficulty1", "difficulty2", "difficulty3", "difficulty4"])
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["1", "2", "3", "4"])
# validator.allowable_values.each do |value|
# expect { instance.difficulty = value }.not_to raise_error
# end
Expand Down
2 changes: 1 addition & 1 deletion spec/models/issue_on_page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
describe 'test attribute "difficulty"' do
it 'should work' do
# assertion here. ref: https://rspec.info/features/3-12/rspec-expectations/built-in-matchers/
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["difficulty1", "difficulty2", "difficulty3", "difficulty4"])
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["1", "2", "3", "4"])
# validator.allowable_values.each do |value|
# expect { instance.difficulty = value }.not_to raise_error
# end
Expand Down

0 comments on commit 9fdf788

Please sign in to comment.