aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/json
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Implement ArraySerializer and move old serialization API to a new ↵José Valim2011-11-301-1/+1
| | | | | | | | | | | | | namespace." This reverts commit 8896b4fdc8a543157cdf4dfc378607ebf6c10ab0. Conflicts: activemodel/lib/active_model.rb activemodel/lib/active_model/serializable.rb activemodel/lib/active_model/serializer.rb activemodel/test/cases/serializer_test.rb
* Implement ArraySerializer and move old serialization API to a new namespace.José Valim2011-11-231-4/+4
| | | | | | | | | | | | | The following constants were renamed: ActiveModel::Serialization => ActiveModel::Serializable ActiveModel::Serializers::JSON => ActiveModel::Serializable::JSON ActiveModel::Serializers::Xml => ActiveModel::Serializable::XML The main motivation for such a change is that `ActiveModel::Serializers::JSON` was not actually a serializer, but a module that when included allows the target to be serializable to JSON. With such changes, we were able to clean up the namespace to add true serializers as the ArraySerializer.
* Set the default options value for as_json in the encoder object.José Valim2011-09-301-2/+2
|
* Removed deprecated methods and related tests from ActiveSupportJosh Kalderimis2011-05-251-3/+0
|
* Use set data structure to speed up circular reference checks on large/deeply ↵Andy Lindeman2011-05-231-4/+4
| | | | nested objects
* add missing require for ordered_hash dependencyCorin Langosch2011-05-111-0/+1
|
* Merge pull request #248 from bigfix/enumerable_as_jsonJosé Valim2011-05-071-1/+3
|\ | | | | Enumerable should pass encoding options to children in #as_json/#to_json
| * Enumerable should pass encoding options to children in #as_json/#to_json.John Firebaugh2011-04-011-1/+3
| |
* | AS Json parse_error makes a return for backwards compatibility, although it ↵Josh Kalderimis2011-04-191-0/+4
| | | | | | | | will return MultiJson::DecodeError
* | removed AS backends and instead rely on MultiJson for json decodingJosh Kalderimis2011-04-184-227/+33
|/
* parse dates to yaml in json arraysDiego Carrion2011-03-221-2/+2
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* test json decoding with time parsing disabled with all backends and respect ↵Diego Carrion2011-03-221-3/+5
| | | | | | ActiveSupport.parse_json_times when converting to yaml Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Updated the json date regex to recognize xmlschema formatted date times ↵Josh Kalderimis2011-02-121-1/+1
| | | | | | during json decoding. [#3031 state:resolved] Signed-off-by: Santiago Pastorino and Emilio Tagua <santiago+emilioe@wyeworks.com>
* Fixes an issue when decoding a json string which looks like a date but is ↵Josh Kalderimis2011-02-113-3/+21
| | | | | | invalid. This DateTime parse error is now caught and the original string is instead passed back [#6286 state:resolved] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Fix JSON decoding of newline character with Yaml backend [#3479 state:resolved]Maxime RETY2011-02-021-2/+6
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* use ! " " YAML string literal syntax rather than removing both quotesAaron Patterson2011-01-211-4/+4
|
* Complex struct encoding fixAlexey Nayden2011-01-151-0/+6
| | | | | | [#6077 state:committed] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* add Psych::SyntaxError to the list of rescued YAML exceptionsAaron Patterson2011-01-041-1/+8
|
* Perf: speed up json encoding.Emilio Tagua2010-09-221-3/+2
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* fixed some issues with JSON encodingJakub Suder2010-09-071-6/+44
| | | | | | | | | | | - as_json in ActiveModel should return a hash and handle :only/:except/:methods options - Array and Hash should call as_json on their elements - json methods should not modify options argument [#5374 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Removes unused varsSantiago Pastorino2010-07-241-1/+1
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Move Date#xmlschema to conversions and add a missing requireSantiago Pastorino2010-07-041-0/+2
|
* Time#formatted_offset is defined in core_ext/time/conversionsSantiago Pastorino2010-07-021-0/+1
| | | | [#4979]
* Time#as_json: use Time#formatted_offset instead of strftime %z directive, ↵Geoff Buesing2010-07-021-1/+1
| | | | | | | | which is non-standard and inaccurate on some platforms (e.g., Mac OS X). [#4979] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Time has it own implementation of xmlschema, now AMo doesn't depend on TZInfoSantiago Pastorino2010-07-021-2/+2
| | | | | | [#4979 state:committed] Signed-off-by: José Valim <jose.valim@gmail.com>
* AS json refactor, move to_json implementation to core_ext and a cleanup a ↵Santiago Pastorino2010-07-012-35/+8
| | | | bit the code
* Work around the fact the JSON gem was overwriting to_json implementation for ↵José Valim2010-06-261-5/+14
| | | | | | | all Ruby core classes. This is required because the JSON gem is incompatible with Rails behavior and was not allowing ActiveModel::Errors to be serialized. So we need to ensure Rails implementation is the one triggered. [#4890 state:resolved]
* Fix Yajl backend discovery in ActiveSupport::JSONMaxime RETY2010-06-181-1/+1
| | | | | | [#4897 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* removes spurious .rb in requireSantiago Pastorino2010-06-131-1/+1
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* adds a comment explaining why BigDecimal#as_json returns a JSON stringXavier Noria2010-05-031-1/+9
|
* Missing require added make pass activesupport/test/json/encoding_test.rb in ↵Santiago Pastorino2010-05-021-0/+1
| | | | | | isolation Signed-off-by: Xavier Noria <fxn@hashref.com>
* use ordinary syntax for options to be well-formed in 1.8Xavier Noria2010-04-271-1/+1
|
* JSON: encode objects that don't have a native JSON representation using ↵Jeremy Kemper2010-04-261-5/+19
| | | | to_hash, if available, instead of instance_values (the old fallback) or to_s (other encoders' default). Encode BigDecimal and Regexp encode as strings to conform with other encoders. Try to transcode non-UTF-8 strings.
* Disprefer JSONGem decoder since it only decodes JSON objectsJeremy Kemper2010-03-091-1/+1
|
* Automatically prefer Yajl or JSON backend over Yaml, if availableJeremy Kemper2010-02-051-1/+16
|
* Add yajl-ruby as a JSON parsing backendBrian Lopez2010-02-051-0/+40
| | | | | | [#2666 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Changed the default ActiveSupport.use_standard_json_time_format from false ↵David Heinemeier Hansson2010-01-031-1/+2
| | | | | | to true and ActiveSupport.escape_html_entities_in_json from true to false to match previously announced Rails 3 defaults [DHH]
* Fix ActiveSupport::JSON encoding of control characters [\x00-\x1f]Dwayne Litzenberger2009-12-231-2/+11
| | | | | | | | | | | | | | According to RFC 4627, only the following Unicode code points are allowed unescaped in JSON: unescaped = %x20-21 / %x23-5B / %x5D-10FFFF However, ActiveSupport::JSON did not escape the range %x00-1f. This caused parse errors when trying to decode the resulting output. [#3345 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Repair time dependenciesJeremy Kemper2009-11-141-1/+1
|
* Ruby 1.9.2: work around changes to flatten and nil.to_strJeremy Kemper2009-11-081-9/+12
|
* Clarify date/time dependenciesJeremy Kemper2009-11-021-3/+0
|
* Clean up spurious JSON decoding test failureJeremy Kemper2009-09-133-8/+5
|
* Fix that JSON parser fails to read escaped backslashes.Daniel Sheppard2009-08-091-1/+4
| | | | | | [#973 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Fixed a bug in JSON decoding with Yaml backend, where a combination of ↵Bas Van Klinkenberg2009-08-081-7/+10
| | | | | | dates, escaped or unicode encoded data and arrays would make the parser fail with a ParseError exception. [#2831 state:resolved] Signed-off-by: Yehuda Katz <wycats@gmail.com>
* JSON.escape returns UTF-8 stringsJeremy Kemper2009-07-011-5/+7
| | | | [#2849 state:resolved]
* uses Hash#except/sliceJeremy Kemper2009-07-011-0/+2
|
* Add basic JSON serializer to AMoJoshua Peek2009-06-172-0/+6
|
* Simplify json decoder backend lazy loadJeremy Kemper2009-06-081-4/+2
|
* Ruby 1.9: fix json encodingJeremy Kemper2009-06-081-1/+2
|
* JSON: split encoding and coercionJeremy Kemper2009-06-0815-211/+240
|