Skip to content

Commit

Permalink
don't set attributes on composed schema
Browse files Browse the repository at this point in the history
  • Loading branch information
zippolyte committed Jul 29, 2021
1 parent 4acacba commit c494bd7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,4 @@
self._additional_properties_model_instances = composed_info[2]
discarded_args = composed_info[3]

for var_name, var_value in kwargs.items():
if var_name in discarded_args and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \
self._additional_properties_model_instances:
# discard variable.
continue
setattr(self, var_name, var_value)

return self
12 changes: 0 additions & 12 deletions .generator/templates/model_templates/method_init_composed.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,3 @@
self._var_name_to_model_instances = composed_info[1]
self._additional_properties_model_instances = composed_info[2]
discarded_args = composed_info[3]

for var_name, var_value in kwargs.items():
if var_name in discarded_args and \
self._configuration is not None and \
self._configuration.discard_unknown_keys and \
self._additional_properties_model_instances:
# discard variable.
continue
setattr(self, var_name, var_value)
if var_name in self.read_only_vars:
raise ApiAttributeError(f"`{var_name}` is a read-only attribute. Use `from_openapi_data` to instantiate "
f"class with read only attributes.")

0 comments on commit c494bd7

Please sign in to comment.