Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ class {{classname}}(object):
"""
Returns true if both objects are equal
"""
if not isinstance(other, {{classname}}):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
2 changes: 1 addition & 1 deletion samples/client/petstore-security-test/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This Python package is automatically generated by the [Swagger Codegen](https://

- API version: 1.0.0 */ ' \" =end -- \\r\\n \\n \\r
- Package version: 1.0.0
- Build package: class io.swagger.codegen.languages.PythonClientCodegen
- Build package: io.swagger.codegen.languages.PythonClientCodegen

## Requirements.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ def __call_api(self, resource_path, method,
collection_formats)
for k, v in path_params:
resource_path = resource_path.replace(
'{%s}' % k, quote(str(v)))
'{%s}' % k, quote(str(v), safe=""))

# query parameters
if query_params:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,9 @@ def test_code_inject____end__rn_n_r_with_http_info(self, **kwargs):
form_params.append(('test code inject */ ' " =end -- \r\n \n \r', params['test_code_inject____end____rn_n_r']))

body_params = None

# HTTP header `Accept`
header_params['Accept'] = self.api_client.\
select_header_accept(['application/json', '*/ \" =end -- '])
if not header_params['Accept']:
del header_params['Accept']

# HTTP header `Content-Type`
header_params['Content-Type'] = self.api_client.\
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, ModelReturn):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, AdditionalPropertiesClass):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
3 changes: 3 additions & 0 deletions samples/client/petstore/python/petstore_api/models/animal.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, Animal):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, AnimalFarm):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, ApiResponse):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, ArrayOfArrayOfNumberOnly):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, ArrayOfNumberOnly):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, ArrayTest):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, Capitalization):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
3 changes: 3 additions & 0 deletions samples/client/petstore/python/petstore_api/models/cat.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, Cat):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, Category):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, ClassModel):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
3 changes: 3 additions & 0 deletions samples/client/petstore/python/petstore_api/models/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, Client):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
3 changes: 3 additions & 0 deletions samples/client/petstore/python/petstore_api/models/dog.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, Dog):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, EnumArrays):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, EnumClass):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, EnumTest):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, FormatTest):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, HasOnlyReadOnly):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
3 changes: 3 additions & 0 deletions samples/client/petstore/python/petstore_api/models/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, List):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, MapTest):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, MixedPropertiesAndAdditionalPropertiesClass):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, Model200Response):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, ModelReturn):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
3 changes: 3 additions & 0 deletions samples/client/petstore/python/petstore_api/models/name.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, Name):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, NumberOnly):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
3 changes: 3 additions & 0 deletions samples/client/petstore/python/petstore_api/models/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, Order):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, OuterEnum):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
3 changes: 3 additions & 0 deletions samples/client/petstore/python/petstore_api/models/pet.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, Pet):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, ReadOnlyFirst):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, SpecialModelName):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
3 changes: 3 additions & 0 deletions samples/client/petstore/python/petstore_api/models/tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, Tag):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down
3 changes: 3 additions & 0 deletions samples/client/petstore/python/petstore_api/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,9 @@ def __eq__(self, other):
"""
Returns true if both objects are equal
"""
if not isinstance(other, User):
return False

return self.__dict__ == other.__dict__

def __ne__(self, other):
Expand Down