[DBIx-Class-Devel] [dbsrgits/sql-translator] don't pass non-JSON specific producer_args to to_json (PR #150)

djerius notifications at github.com
Tue Oct 4 19:19:33 GMT 2022


The producer_args passed by sqlt contains a number of keys which are not specific to JSON.  These were passed unfiltered to to_json(). JSON (at least as of v2.90) will throw an error if it is passed an unknown option (it uses the option key as a method name, which leads to confusing error messages).

It's not straightforward to automatically determine the args supported by the JSON module, so this simply whitelist the 'pretty', 'indent', and 'canonical' options.
You can view, comment on, or merge this pull request online at:

  https://github.com/dbsrgits/sql-translator/pull/150

-- Commit Summary --

  * don't pass non-JSON specific producer_args to to_json

-- File Changes --

    M lib/SQL/Translator/Producer/JSON.pm (4)
    M t/23json.t (4)

-- Patch Links --

https://github.com/dbsrgits/sql-translator/pull/150.patch
https://github.com/dbsrgits/sql-translator/pull/150.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/dbsrgits/sql-translator/pull/150
You are receiving this because you are subscribed to this thread.

Message ID: <dbsrgits/sql-translator/pull/150 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.scsys.co.uk/pipermail/dbix-class-devel/attachments/20221004/1180482c/attachment.htm>


More information about the DBIx-Class-Devel mailing list