Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

ParamsParser and request body streams

#2659

Per Joshua's request from:
http://groups.google.com/group/rubyonrails-core/browse_thread/threa...

This is a patch adding support to the XML and JSON plugable backends to be able to parse from a string, or an IO (for streaming). The ParamsParser middleware was also updated to pass the request.body IO object directly to the parsers.

It also includes a JSON parsing backend for yajl-ruby (streaming JSON parser in C).

Reported by Brian Lopez · May 17th, 2009 @ 04:12 AM

State: resolved
Milestone: 3.0.2
Assigned to: josh josh
Importance: Low

Activity

  1. Brian Lopez
    Brian Lopez

    just uploading it with a .diff extension, per the docs on how to submit a patch

    May 17th, 2009 @ 04:12 AM

  2. Brian Lopez
    Brian Lopez

    Although I've only added support such that the API doesn't break for the existing parsers, the only one that actually parses off the IO itself (without simply converting itself into a string because said backend can't parse as a stream) is the JSON backend yajl-ruby.

    Although, the idea here is that backends like libxml and/or nokogiri could also be refactored at some point to support parsing directly off the IO. Not to say the others couldn't as well, or future parsers that will either be integrated into core, or as plugins.

    May 17th, 2009 @ 04:23 AM

  3. Repository
    Repository
    • State changed from new to resolved

    (from [53dda29f8b34073a4b135ee224c1d09c1f10de02]) Add support for parsing XML and JSON from an IO as well as a string [#2659 ParamsParser and request body streams state:resolved]

    Signed-off-by: Joshua Peek josh@joshpeek.com
    http://github.com/rails/rails/commit/53dda29f8b34073a4b135ee224c1d0...

    May 17th, 2009 @ 04:38 PM

  4. Brian Lopez
    Brian Lopez

    What was the reason for removing the yajl-ruby backend and updated JSON test?
    I realize now that I should have noted somewhere that the JSON test and yajl.rb backend were written by Rick Olson, and I merged them into my local clone.

    May 17th, 2009 @ 05:52 PM

  5. Brian Lopez
    Brian Lopez

    Also, YAML.load_stream was changed back to YAML.load - was this because I didn't specify that in the ticket subject?

    May 17th, 2009 @ 06:44 PM

  6. josh
    josh

    Yeah, I held off on the yajl. I figured Rick was working on that or something. Can you make a special ticket for that and assign it to him.

    I had to revert the YAML change because it broke a bunch of tests. YAML.load_stream doesn't return a string, it returns some weird YAML IO thing. I couldn't get it to work right. Accepting updates ;)

    May 17th, 2009 @ 07:48 PM

  7. Brian Lopez
    Brian Lopez

    I must have missed this in the docs, but apparently YAML.load can accept an IO. Appears to work exactly like passing it a string.

    May 17th, 2009 @ 08:44 PM

  8. Brian Lopez
    Brian Lopez

    So I know this ticket has been marked resolved, but this patch compliments the other two by enabling true IO parsing for the libxml, nokogiri and rexml backends.

    Any chances to get this in as well? Should I create a new ticket?

    May 31st, 2009 @ 02:50 AM

  9. josh
    josh
    • Milestone cleared.
    • State changed from resolved to open

    Thanks, I'll commit it soon.

    Next time, just open a new ticket with the additional changes.

    May 31st, 2009 @ 05:51 AM

  10. Repository
    Repository
    • State changed from open to resolved

    (from [69bc2043f93890048e415dd7c5f1feba5a20d145]) enable real IO parsing for the libxml, nokogiri and rexml backends [#2659 ParamsParser and request body streams state:resolved]

    Signed-off-by: Joshua Peek josh@joshpeek.com
    http://github.com/rails/rails/commit/69bc2043f93890048e415dd7c5f1fe...

    June 9th, 2009 @ 03:02 PM

  11. Jeremy Kemper
  12. Jeff Kreeftmeijer
    Jeff Kreeftmeijer
    • Tag cleared.
    • Importance changed from to Low

    Automatic cleanup of spam.

    November 7th, 2010 @ 04:52 PM