[Json] Monetary type: JSON Schema Language is nearly done

Anders Rundgren <anders.rundgren.net@gmail.com> Fri, 02 August 2019 05:20 UTC

Return-Path: <anders.rundgren.net@gmail.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 05553120132 for <json@ietfa.amsl.com>; Thu, 1 Aug 2019 22:20:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cDkYBYlJl7ri for <json@ietfa.amsl.com>; Thu, 1 Aug 2019 22:20:57 -0700 (PDT)
Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id CF175120044 for <json@ietf.org>; Thu, 1 Aug 2019 22:20:56 -0700 (PDT)
Received: by mail-wm1-x331.google.com with SMTP id g67so60974441wme.1 for <json@ietf.org>; Thu, 01 Aug 2019 22:20:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:from:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=+PSENgvkMCBAXgqjSlLDZ9aH3tpRyPWXvD/TbEpqI+M=; b=biZ1Mxu4wzoOtgXA6PrLmpUIFjUEdlTsucqsOaLsScxzEqraNdQ3KG0SeNhbx0ONM5 TcZchwyRg36fAI57L0GSoeYfC1Qigsy+0mwOSuPa1fSgemyk1daYcJOs6ckaSl+zbEsm Ez6cw5DR8ufYWB5pTfgqLYVigf+9L+T+RQnNuZ7RxGc1oX6zxRWaBsj3+W7XdpKwVmtb t97qEbjqNSyaql1tlhKiN+K+lfFiyfG8WONqA+0mdF/Uv6tQpp12Mogy0iUgeMWJPJcB bPiMGIqdU2FbsMryV4ONpXp3h21a3U2xLqJlvyE6SwiitMzBcXv7JZEqepV71ecPa2ZK 2I5w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:from:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=+PSENgvkMCBAXgqjSlLDZ9aH3tpRyPWXvD/TbEpqI+M=; b=XrbP7q8WMUomHCDZw8Rje20JHdmRN8xboo9ThEYBjsZxif5tp9QS0gWpfHjcvjOAha LxCGVKcF5cCT5nOTmhSfgDl8LNRL0+4I9jdl1cJ0V9CnvpulI9u9k9BWLIaFvwErXCNj ANzSLsck/iBaDI9xgUe6X+6ncK7krWm8KMBDm45s9Oo27HCmoddoLgkQf/WifnDxdi/d 49hX+8ZYMfA9hq7A5K9AYoo6xSNyQMuW6ofZHwPrOwcvVx04ViIqHrcdghWGmGwdI+Ur 68cY/lQjLDjl0fGOr/TZc5j6gz7pzM7eDf/FQbHGpLga4sE0uOTnnJqGrh9iiez8HjbP RGNg==
X-Gm-Message-State: APjAAAUE7UJWao5N3k0l9/JeAeWWqXTqusDuYCoucMB+SJGaFwgJoFgm dZQ/njCeB+9AFsyZNKnpObsDEH+x
X-Google-Smtp-Source: APXvYqzwyyu165hwGuvmS90mVQNBAvkKDzqRmrSyrrS47/oMdPGlfdKkuZ4DxrCHfzUnJk/qFGLWAA==
X-Received: by 2002:a05:600c:490:: with SMTP id d16mr2272565wme.104.1564723254767; Thu, 01 Aug 2019 22:20:54 -0700 (PDT)
Received: from [192.168.1.79] (25.131.146.77.rev.sfr.net. [77.146.131.25]) by smtp.googlemail.com with ESMTPSA id v65sm85380344wme.31.2019.08.01.22.20.53 for <json@ietf.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Aug 2019 22:20:53 -0700 (PDT)
From: Anders Rundgren <anders.rundgren.net@gmail.com>
To: JSON WG <json@ietf.org>
References: <SY2PR01MB27642C6983E387C397B11581E5DD0@SY2PR01MB2764.ausprd01.prod.outlook.com> <CAJK=1RjhuCYJe4-BSB++8+-dHG3LV8TdqsnFEPAoAkfJ1mOE3A@mail.gmail.com> <SY2PR01MB2764AD4523625006B1F3DFEBE5DC0@SY2PR01MB2764.ausprd01.prod.outlook.com> <aeb4dfcc-4227-2d8e-d1dc-914d078450fe@gmail.com> <SY2PR01MB2764600E16BA7A19025964EFE5DF0@SY2PR01MB2764.ausprd01.prod.outlook.com> <7f663d84-eb38-271f-12c3-a0f4a2261090@gmail.com> <CAJK=1RjqqtZvdWBJNXR6ebKFT1KSkNJHQjiydQ7RJX6aPyB+9g@mail.gmail.com> <CAD2gp_QWcVVbnmuZfuqawR1fW7=iVgtuD1tKWVQ=ME3gjDORvQ@mail.gmail.com> <5ECB215B-AA05-47AB-AC8F-F14A74A46FEE@tzi.org> <df86cce7-f6f4-2077-6076-6d550368c6f6@gmail.com>
Message-ID: <c93c4be2-e8c7-4af3-fcb6-9203f079166b@gmail.com>
Date: Fri, 02 Aug 2019 07:20:51 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0
MIME-Version: 1.0
In-Reply-To: <df86cce7-f6f4-2077-6076-6d550368c6f6@gmail.com>
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/62Ag1xLoePQEcPgurQn8HRJOXUI>
Subject: [Json] Monetary type: JSON Schema Language is nearly done
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <json.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/json>, <mailto:json-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/json/>
List-Post: <mailto:json@ietf.org>
List-Help: <mailto:json-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/json>, <mailto:json-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 02 Aug 2019 05:20:59 -0000

https://www.w3.org/TR/payment-request/#dfn-valid-decimal-monetary-value
It has been agreed upon by payment folks from Google, Microsoft, VISA, etc.
Published Open Banking API's have AFAIK adopted this scheme as well.

The previously posted link rot due an API change...
https://cyberphone.github.io/doc/openkeystore/javaapi/org/webpki/json/JSONObjectWriter.html#setMoney-java.lang.String-java.math.BigDecimal-int%2d

For those who insist that JSON Number is the only "true" way of serializing numbers in JSON, a "number" type would be the logical choice.

/anders