Skip to content

Commit 97acc3b

Browse files
authored
Fix additionalproperties generation issue in models (#2145)
1 parent 143aa31 commit 97acc3b

File tree

1,953 files changed

+3906
-3906
lines changed

Some content is hidden

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

1,953 files changed

+3906
-3906
lines changed

.generator/src/generator/templates/model_generic.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@
271271
return true if self.equal?(o)
272272
self.class == o.class &&
273273
{%- for attr in model.properties %}
274-
{{ attr|attribute_name }} == o.{{ attr|attribute_name }}{% if not loop.last or model.get("additionalProperties") %} &&{% endif %}
274+
{{ attr|attribute_name }} == o.{{ attr|attribute_name }}{% if not loop.last or additionalProperties is not false %} &&{% endif %}
275275
{%- endfor %}
276276
{%- if additionalProperties is not false %}
277277
additional_properties == o.additional_properties
@@ -282,6 +282,6 @@
282282
# @return [Integer] Hash code
283283
# @!visibility private
284284
def hash
285-
[{% for attr in model.properties %}{{ attr|attribute_name }}{% if not loop.last or model.get("additionalProperties") %}, {% endif %}{% endfor %}{% if model.get("additionalProperties") %}additional_properties{% endif %}].hash
285+
[{% for attr in model.properties %}{{ attr|attribute_name }}{% if not loop.last or additionalProperties is not false %}, {% endif %}{% endfor %}{% if additionalProperties is not false %}additional_properties{% endif %}].hash
286286
end
287287
end

lib/datadog_api_client/v1/models/add_signal_to_incident_request.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,15 +129,15 @@ def ==(o)
129129
self.class == o.class &&
130130
add_to_signal_timeline == o.add_to_signal_timeline &&
131131
incident_id == o.incident_id &&
132-
version == o.version
132+
version == o.version &&
133133
additional_properties == o.additional_properties
134134
end
135135

136136
# Calculates hash code according to all attributes.
137137
# @return [Integer] Hash code
138138
# @!visibility private
139139
def hash
140-
[add_to_signal_timeline, incident_id, version].hash
140+
[add_to_signal_timeline, incident_id, version, additional_properties].hash
141141
end
142142
end
143143
end

lib/datadog_api_client/v1/models/alert_graph_widget_definition.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,15 +191,15 @@ def ==(o)
191191
title_align == o.title_align &&
192192
title_size == o.title_size &&
193193
type == o.type &&
194-
viz_type == o.viz_type
194+
viz_type == o.viz_type &&
195195
additional_properties == o.additional_properties
196196
end
197197

198198
# Calculates hash code according to all attributes.
199199
# @return [Integer] Hash code
200200
# @!visibility private
201201
def hash
202-
[alert_id, time, title, title_align, title_size, type, viz_type].hash
202+
[alert_id, time, title, title_align, title_size, type, viz_type, additional_properties].hash
203203
end
204204
end
205205
end

lib/datadog_api_client/v1/models/alert_value_widget_definition.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,15 +190,15 @@ def ==(o)
190190
title_align == o.title_align &&
191191
title_size == o.title_size &&
192192
type == o.type &&
193-
unit == o.unit
193+
unit == o.unit &&
194194
additional_properties == o.additional_properties
195195
end
196196

197197
# Calculates hash code according to all attributes.
198198
# @return [Integer] Hash code
199199
# @!visibility private
200200
def hash
201-
[alert_id, precision, text_align, title, title_align, title_size, type, unit].hash
201+
[alert_id, precision, text_align, title, title_align, title_size, type, unit, additional_properties].hash
202202
end
203203
end
204204
end

lib/datadog_api_client/v1/models/api_error_response.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,15 @@ def to_hash
111111
def ==(o)
112112
return true if self.equal?(o)
113113
self.class == o.class &&
114-
errors == o.errors
114+
errors == o.errors &&
115115
additional_properties == o.additional_properties
116116
end
117117

118118
# Calculates hash code according to all attributes.
119119
# @return [Integer] Hash code
120120
# @!visibility private
121121
def hash
122-
[errors].hash
122+
[errors, additional_properties].hash
123123
end
124124
end
125125
end

lib/datadog_api_client/v1/models/api_key.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,15 @@ def ==(o)
143143
created == o.created &&
144144
created_by == o.created_by &&
145145
key == o.key &&
146-
name == o.name
146+
name == o.name &&
147147
additional_properties == o.additional_properties
148148
end
149149

150150
# Calculates hash code according to all attributes.
151151
# @return [Integer] Hash code
152152
# @!visibility private
153153
def hash
154-
[created, created_by, key, name].hash
154+
[created, created_by, key, name, additional_properties].hash
155155
end
156156
end
157157
end

lib/datadog_api_client/v1/models/api_key_list_response.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,15 +93,15 @@ def to_hash
9393
def ==(o)
9494
return true if self.equal?(o)
9595
self.class == o.class &&
96-
api_keys == o.api_keys
96+
api_keys == o.api_keys &&
9797
additional_properties == o.additional_properties
9898
end
9999

100100
# Calculates hash code according to all attributes.
101101
# @return [Integer] Hash code
102102
# @!visibility private
103103
def hash
104-
[api_keys].hash
104+
[api_keys, additional_properties].hash
105105
end
106106
end
107107
end

lib/datadog_api_client/v1/models/api_key_response.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,15 @@ def to_hash
9191
def ==(o)
9292
return true if self.equal?(o)
9393
self.class == o.class &&
94-
api_key == o.api_key
94+
api_key == o.api_key &&
9595
additional_properties == o.additional_properties
9696
end
9797

9898
# Calculates hash code according to all attributes.
9999
# @return [Integer] Hash code
100100
# @!visibility private
101101
def hash
102-
[api_key].hash
102+
[api_key, additional_properties].hash
103103
end
104104
end
105105
end

lib/datadog_api_client/v1/models/apm_stats_query_column_type.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,15 @@ def ==(o)
139139
_alias == o._alias &&
140140
cell_display_mode == o.cell_display_mode &&
141141
name == o.name &&
142-
order == o.order
142+
order == o.order &&
143143
additional_properties == o.additional_properties
144144
end
145145

146146
# Calculates hash code according to all attributes.
147147
# @return [Integer] Hash code
148148
# @!visibility private
149149
def hash
150-
[_alias, cell_display_mode, name, order].hash
150+
[_alias, cell_display_mode, name, order, additional_properties].hash
151151
end
152152
end
153153
end

lib/datadog_api_client/v1/models/apm_stats_query_definition.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,15 +215,15 @@ def ==(o)
215215
primary_tag == o.primary_tag &&
216216
resource == o.resource &&
217217
row_type == o.row_type &&
218-
service == o.service
218+
service == o.service &&
219219
additional_properties == o.additional_properties
220220
end
221221

222222
# Calculates hash code according to all attributes.
223223
# @return [Integer] Hash code
224224
# @!visibility private
225225
def hash
226-
[columns, env, name, primary_tag, resource, row_type, service].hash
226+
[columns, env, name, primary_tag, resource, row_type, service, additional_properties].hash
227227
end
228228
end
229229
end

0 commit comments

Comments
 (0)