Skip to content
This repository has been archived by the owner on Jul 12, 2020. It is now read-only.

Shallow copy or deep copy? #665

Open
ghost opened this issue Jun 30, 2015 · 0 comments
Open

Shallow copy or deep copy? #665

ghost opened this issue Jun 30, 2015 · 0 comments

Comments

@ghost
Copy link

ghost commented Jun 30, 2015

The note about the attributes object passed to validate() says:

This object is distinct from the current attributes of the model and from the parameters passed to the operation. Since it is created by shallow copy, it is not possible to change any Number, String, or Boolean attribute of the input within the function, but it is possible to change attributes in nested objects.

So, the nested objects can be changed because they are deep copied? Aren't nested objects the ones that are shallow copied and everything else (direct members of attributes object) is deep copied?

@ghost ghost changed the title Shallow copy instead or deep copy? Shallow copy or deep copy? Jun 30, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants