Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nested raw json for encoder #96

Open
zmstone opened this issue Jun 18, 2016 · 3 comments
Open

nested raw json for encoder #96

zmstone opened this issue Jun 18, 2016 · 3 comments

Comments

@zmstone
Copy link

zmstone commented Jun 18, 2016

Hi There!

Is it possible to have a inner part of an object encoded already,
and jsx takes the inner part 'as is' when encoding the wrapping object ?
like https://github.com/tophitpoker/mochijson3/blob/master/src/mochijson3.erl#L111

It seems the equivalent in jsx is {'raw', binary()}
https://github.com/talentdeficit/jsx/blob/develop/src/jsx_parser.erl#L110
But the 'Raw' json is decoded there, then encoded back again later on.
Is this to validate the raw part ?

What do you think if I add a {json, TrustedRaw} clause (or a trust_raw encoder config) ?

@talentdeficit
Copy link
Owner

a trusted raw option would still have to be decoded because of the way jsx works internally.

all the valid input types are parsed into an AST that is then consumed by handlers. it would be possible to add a raw type to the AST but that would break all existing handlers so it would have to be in a 3.0 version

@mpenet
Copy link

mpenet commented Nov 29, 2016

Hi,

I am actually looking at doing the exact same thing, I am building a json document out of other documents (already validated) and would like to avoid as much overhead as I can.

@paulo-ferraz-oliveira
Copy link
Contributor

This seems more or less related to #119. @talentdeficit: did it make its way to 3.0?

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

No branches or pull requests

4 participants