Skip to content

Commit bd48af8

Browse files
authored
Ignore error by steep for Model#create (#478)
Since there are sufficient tests, I thought this could be ignored.
1 parent fbbc467 commit bd48af8

306 files changed

Lines changed: 892 additions & 910 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

generator/src/main/resources/line-bot-sdk-ruby-generator/api.pebble

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ module Line
114114
json.transform_keys! do |key|
115115
Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
116116
end
117-
Line::Bot::V2::{{ packageName | camelize }}::{{ response.content['application/json'].schema.complexType }}.new(**json)
117+
Line::Bot::V2::{{ packageName | camelize }}::{{ response.content['application/json'].schema.complexType }}.new(**json) # steep:ignore InsufficientKeywordArguments
118118
{%- else %}
119119
response.body
120120
{%- endif %}{% endfor %}

generator/src/main/resources/line-bot-sdk-ruby-generator/model.pebble

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ module Line
8080
end
8181
end
8282
{%- elseif property.isModel -%}
83-
@{{ property.name }} = {{ property.name }}.is_a?(Line::Bot::V2::{{ packageName | camelize }}::{{ property.baseType }}){% if not property.required %} || {{ property.name }}.nil?{% endif %} ? {{ property.name }} : Line::Bot::V2::{{ packageName | camelize }}::{{ property.baseType }}.create(**{{ property.name }})
83+
@{{ property.name }} = {{ property.name }}.is_a?(Line::Bot::V2::{{ packageName | camelize }}::{{ property.baseType }}){% if not property.required %} || {{ property.name }}.nil?{% endif %} ? {{ property.name }} : Line::Bot::V2::{{ packageName | camelize }}::{{ property.baseType }}.create(**{{ property.name }}) # steep:ignore
8484
{%- elseif model.model.vendorExtensions.get("x-selector").propertyName != property.name -%}
8585
@{{ property.name }} = {{ property.name }}
8686
{%- endif -%}
@@ -99,17 +99,18 @@ module Line
9999
end
100100
end
101101

102-
def self.create(args){% if model.model.vendorExtensions.get("x-children") != null and model.model.vendorExtensions.get("x-discriminator-property") != null %}
103-
klass = detect_class(args[:{{ model.model.vendorExtensions.get("x-discriminator-property") }}])
104-
return klass.new(**args) if klass
105-
{% endif %}
106-
return new(**args)
102+
def self.create(args) # steep:ignore
103+
{%- if model.model.vendorExtensions.get("x-children") != null and model.model.vendorExtensions.get("x-discriminator-property") != null %}
104+
klass = detect_class(type: args[:{{ model.model.vendorExtensions.get("x-discriminator-property") }}])
105+
return klass.new(**args) if klass # steep:ignore
106+
{%- endif %}
107+
return new(**args) # steep:ignore
107108
end
108109
{%- if model.model.vendorExtensions.get("x-children") != null %}
109110

110111
private
111112

112-
def self.detect_class(type)
113+
def self.detect_class(type:)
113114
{
114115
{%- for child in model.model.vendorExtensions.get("x-children") %}
115116
{{ child.typeName }}: Line::Bot::V2::{{ packageName | camelize }}::{{ child.className }},

lib/line/bot/v2/channel_access_token/api/channel_access_token_client.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def gets_all_valid_channel_access_token_key_ids_with_http_info(
6969
json.transform_keys! do |key|
7070
Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
7171
end
72-
Line::Bot::V2::ChannelAccessToken::ChannelAccessTokenKeyIdsResponse.new(**json)
72+
Line::Bot::V2::ChannelAccessToken::ChannelAccessTokenKeyIdsResponse.new(**json) # steep:ignore InsufficientKeywordArguments
7373
else
7474
response.body
7575
end
@@ -131,13 +131,13 @@ def issue_channel_token_with_http_info(
131131
json.transform_keys! do |key|
132132
Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
133133
end
134-
Line::Bot::V2::ChannelAccessToken::IssueShortLivedChannelAccessTokenResponse.new(**json)
134+
Line::Bot::V2::ChannelAccessToken::IssueShortLivedChannelAccessTokenResponse.new(**json) # steep:ignore InsufficientKeywordArguments
135135
when 400
136136
json = Line::Bot::V2::Utils.deep_underscore(JSON.parse(response.body))
137137
json.transform_keys! do |key|
138138
Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
139139
end
140-
Line::Bot::V2::ChannelAccessToken::ErrorResponse.new(**json)
140+
Line::Bot::V2::ChannelAccessToken::ErrorResponse.new(**json) # steep:ignore InsufficientKeywordArguments
141141
else
142142
response.body
143143
end
@@ -202,7 +202,7 @@ def issue_channel_token_by_jwt_with_http_info(
202202
json.transform_keys! do |key|
203203
Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
204204
end
205-
Line::Bot::V2::ChannelAccessToken::IssueChannelAccessTokenResponse.new(**json)
205+
Line::Bot::V2::ChannelAccessToken::IssueChannelAccessTokenResponse.new(**json) # steep:ignore InsufficientKeywordArguments
206206
else
207207
response.body
208208
end
@@ -272,7 +272,7 @@ def issue_stateless_channel_token_with_http_info(
272272
json.transform_keys! do |key|
273273
Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
274274
end
275-
Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse.new(**json)
275+
Line::Bot::V2::ChannelAccessToken::IssueStatelessChannelAccessTokenResponse.new(**json) # steep:ignore InsufficientKeywordArguments
276276
else
277277
response.body
278278
end
@@ -444,7 +444,7 @@ def verify_channel_token_with_http_info(
444444
json.transform_keys! do |key|
445445
Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
446446
end
447-
Line::Bot::V2::ChannelAccessToken::VerifyChannelAccessTokenResponse.new(**json)
447+
Line::Bot::V2::ChannelAccessToken::VerifyChannelAccessTokenResponse.new(**json) # steep:ignore InsufficientKeywordArguments
448448
else
449449
response.body
450450
end
@@ -495,7 +495,7 @@ def verify_channel_token_by_jwt_with_http_info(
495495
json.transform_keys! do |key|
496496
Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
497497
end
498-
Line::Bot::V2::ChannelAccessToken::VerifyChannelAccessTokenResponse.new(**json)
498+
Line::Bot::V2::ChannelAccessToken::VerifyChannelAccessTokenResponse.new(**json) # steep:ignore InsufficientKeywordArguments
499499
else
500500
response.body
501501
end

lib/line/bot/v2/channel_access_token/model/channel_access_token_key_ids_response.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ def initialize(
4545
end
4646
end
4747

48-
def self.create(args)
49-
return new(**args)
48+
def self.create(args) # steep:ignore
49+
return new(**args) # steep:ignore
5050
end
5151
end
5252
end

lib/line/bot/v2/channel_access_token/model/error_response.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ def initialize(
4444
end
4545
end
4646

47-
def self.create(args)
48-
return new(**args)
47+
def self.create(args) # steep:ignore
48+
return new(**args) # steep:ignore
4949
end
5050
end
5151
end

lib/line/bot/v2/channel_access_token/model/issue_channel_access_token_response.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ def initialize(
5757
end
5858
end
5959

60-
def self.create(args)
61-
return new(**args)
60+
def self.create(args) # steep:ignore
61+
return new(**args) # steep:ignore
6262
end
6363
end
6464
end

lib/line/bot/v2/channel_access_token/model/issue_short_lived_channel_access_token_response.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ def initialize(
5151
end
5252
end
5353

54-
def self.create(args)
55-
return new(**args)
54+
def self.create(args) # steep:ignore
55+
return new(**args) # steep:ignore
5656
end
5757
end
5858
end

lib/line/bot/v2/channel_access_token/model/issue_stateless_channel_access_token_response.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ def initialize(
5151
end
5252
end
5353

54-
def self.create(args)
55-
return new(**args)
54+
def self.create(args) # steep:ignore
55+
return new(**args) # steep:ignore
5656
end
5757
end
5858
end

lib/line/bot/v2/channel_access_token/model/verify_channel_access_token_response.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ def initialize(
5050
end
5151
end
5252

53-
def self.create(args)
54-
return new(**args)
53+
def self.create(args) # steep:ignore
54+
return new(**args) # steep:ignore
5555
end
5656
end
5757
end

lib/line/bot/v2/insight/api/insight_client.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def get_friends_demographics_with_http_info(
6565
json.transform_keys! do |key|
6666
Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
6767
end
68-
Line::Bot::V2::Insight::GetFriendsDemographicsResponse.new(**json)
68+
Line::Bot::V2::Insight::GetFriendsDemographicsResponse.new(**json) # steep:ignore InsufficientKeywordArguments
6969
else
7070
response.body
7171
end
@@ -113,7 +113,7 @@ def get_message_event_with_http_info(
113113
json.transform_keys! do |key|
114114
Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
115115
end
116-
Line::Bot::V2::Insight::GetMessageEventResponse.new(**json)
116+
Line::Bot::V2::Insight::GetMessageEventResponse.new(**json) # steep:ignore InsufficientKeywordArguments
117117
else
118118
response.body
119119
end
@@ -164,7 +164,7 @@ def get_number_of_followers_with_http_info(
164164
json.transform_keys! do |key|
165165
Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
166166
end
167-
Line::Bot::V2::Insight::GetNumberOfFollowersResponse.new(**json)
167+
Line::Bot::V2::Insight::GetNumberOfFollowersResponse.new(**json) # steep:ignore InsufficientKeywordArguments
168168
else
169169
response.body
170170
end
@@ -215,7 +215,7 @@ def get_number_of_message_deliveries_with_http_info(
215215
json.transform_keys! do |key|
216216
Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
217217
end
218-
Line::Bot::V2::Insight::GetNumberOfMessageDeliveriesResponse.new(**json)
218+
Line::Bot::V2::Insight::GetNumberOfMessageDeliveriesResponse.new(**json) # steep:ignore InsufficientKeywordArguments
219219
else
220220
response.body
221221
end
@@ -272,7 +272,7 @@ def get_statistics_per_unit_with_http_info(
272272
json.transform_keys! do |key|
273273
Line::Bot::V2::RESERVED_WORDS.include?(key) ? "_#{key}".to_sym : key
274274
end
275-
Line::Bot::V2::Insight::GetStatisticsPerUnitResponse.new(**json)
275+
Line::Bot::V2::Insight::GetStatisticsPerUnitResponse.new(**json) # steep:ignore InsufficientKeywordArguments
276276
else
277277
response.body
278278
end

0 commit comments

Comments
 (0)