From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS4713 221.184.0.0/13 X-Spam-Status: No, score=-3.1 required=3.0 tests=AWL,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by dcvr.yhbt.net (Postfix) with ESMTP id BD64B1F62E for ; Wed, 16 Jan 2019 02:04:54 +0000 (UTC) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 8D20D1212BC; Wed, 16 Jan 2019 11:04:51 +0900 (JST) Received: from o1678916x28.outbound-mail.sendgrid.net (o1678916x28.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 081EE120C40 for ; Wed, 16 Jan 2019 11:04:48 +0900 (JST) Received: by filter0033p3iad2.sendgrid.net with SMTP id filter0033p3iad2-10538-5C3E913E-B 2019-01-16 02:04:46.204334983 +0000 UTC m=+104063.589864292 Received: from herokuapp.com (ec2-54-92-132-214.compute-1.amazonaws.com [54.92.132.214]) by ismtpd0015p1iad1.sendgrid.net (SG) with ESMTP id y4LKfu6fQeKwamFcxbTaLQ for ; Wed, 16 Jan 2019 02:04:46.130 +0000 (UTC) Date: Wed, 16 Jan 2019 02:04:47 +0000 (UTC) From: shevegen@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 66567 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 15541 X-Redmine-Issue-Author: baweaver X-Redmine-Sender: shevegen X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS7kImH6HkXZjGJV/pl/8W+z26x71NfMfDvmMN 8fqwFxPMrHZ9EuHuWbruUO16fd66WAxKa1ULiC+ihY812iKRTn2sM9ItF9h2ugQh6awLgk2RBG5v33 jkZvS3cvhwSGHfp+DHwNFQxv7+ImweQSeveGAPKtd6jUWgUVnc2uUVbkVQ== X-ML-Name: ruby-core X-Mail-Count: 91116 Subject: [ruby-core:91116] [Ruby trunk Feature#15541] Add alias symbolize_keys for symbolize_names kwarg for JSON.parse X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #15541 has been updated by shevegen (Robert A. Heiler). Personally I think that alias name would make sense. With a new alias the backwards behaviour would also be retained. ---------------------------------------- Feature #15541: Add alias symbolize_keys for symbolize_names kwarg for JSON.parse https://bugs.ruby-lang.org/issues/15541#change-76349 * Author: baweaver (Brandon Weaver) * Status: Open * Priority: Normal * Assignee: * Target version: ---------------------------------------- https://github.com/ruby/psych/issues/341 When trying to symbolize keys on JSON parsing, it's really hard to remember the name `symbolize_names`: ``` JSON.parse(data, symbolize_names: true) ``` I would like to propose that we change this keyword to `symbolize_keys` to be more clear: ``` JSON.parse(data, symbolize_keys: true) ``` The documentation for this method also reflects the confusion: http://ruby-doc.org/stdlib-2.6/libdoc/json/rdoc/JSON.html#method-i-parse-21 ``` symbolize_names: If set to true, returns symbols for the names (keys) in a JSON object. Otherwise strings are returned. Strings are the default. ``` The same issue came up in Psych not too long ago: https://github.com/ruby/psych/issues/341 I believe the current name causes confusion. Would it be possible to add an alias to this keyword for clarity? -- https://bugs.ruby-lang.org/