Skip to content

Do not expose internal state in the public encoder API (i.e. as_json)#12785

Merged
jeremy merged 2 commits intorails:masterfrom
chancancode:do_not_leak_internal_state
Nov 7, 2013
Merged

Do not expose internal state in the public encoder API (i.e. as_json)#12785
jeremy merged 2 commits intorails:masterfrom
chancancode:do_not_leak_internal_state

Conversation

@chancancode
Copy link
Member

See 1 for why this is not a good idea.

As part of this refactor, circular reference protection in as_json has
been removed and the corresponding error class has been deprecated.

As discussed with @jeremy, circular reference error is considered
programmer errors and protecting against it is out of scope for
the encoder.

This is again based on the excellent work by @sergiocampama in #11728.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

map{ -> map {

@ghost ghost assigned jeremy Nov 6, 2013
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, fixed

See [1] for why this is not a good idea.

As part of this refactor, circular reference protection in as_json has
been removed and the corresponding error class has been deprecated.

As discussed with @jeremy, circular reference error is considered
programmer errors and protecting against it is out of scope for
the encoder.

This is again based on the excellent work by @sergiocampama in rails#11728.

[1]: intridea/multi_json#138 (comment)
jeremy added a commit that referenced this pull request Nov 7, 2013
Do not expose internal state in the public encoder API (i.e. as_json)
@jeremy jeremy merged commit 240863a into rails:master Nov 7, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants