File tree Expand file tree Collapse file tree 3 files changed +110
-0
lines changed
Expand file tree Collapse file tree 3 files changed +110
-0
lines changed Original file line number Diff line number Diff line change 1+ $schema : https://json-schema.org/draft/2020-12/schema
2+ $id : https://example.com/product.schema.json
3+ title : Money
4+ description : |
5+ Represents an amount of money with its currency type.
6+
7+ Examples:
8+
9+ Five US dollars === `{"currency_code": "USD", "quantity": {"significand": 5}}`
10+ One and a half Bitcoin ===
11+ `{"currency_code": "X-BTC", "quantity": {"significand": 15, "exponent": -1}}`
12+ type : object
13+ required :
14+ - currency_code
15+ - quantity
16+ additionalProperties : false
17+ properties :
18+ currency_code :
19+ description : |
20+ A currency code.
21+
22+ This may be a three-letter currency code defined in ISO 4217.
23+
24+ APIs may define additional currency codes that are not included in the ISO
25+ 4217 standard (for example, virtual currencies or cryptocurrencies). These
26+ must start with "X-", in order to distinguish them from potential future
27+ ISO 4217 codes.
28+
29+ Examples:
30+ "USD" - ISO 4217 code for United States dollar.
31+ "X-BTC" - Potential API-defined extension for Bitcoin.
32+ "X-RBX" - Potential API-defined extension for the virtual currency Robux.
33+ type : string
34+ quantity :
35+ description : The quantity of currency.
36+ $ref : decimal.yaml#/definitions/Decimal
Original file line number Diff line number Diff line change 1+ syntax = "proto3" ;
2+
3+ package aip.type ;
4+
5+ option cc_enable_arenas = true ;
6+ option go_package = "aip.golang.org/genproto/common-components/type/money;money" ;
7+ option java_multiple_files = true ;
8+ option java_outer_classname = "MoneyProto" ;
9+ option java_package = "dev.aip.type" ;
10+ option objc_class_prefix = "AIP" ;
11+
12+ import "aip/type/decimal.proto" ;
13+
14+ // Represents an amount of money with its currency type.
15+ //
16+ // Examples:
17+ //
18+ // Five US dollars === `{currency_code: "USD" quantity: {significand: 5}}`
19+ // One and a half Bitcoin ===
20+ // `{currency_code: "X-BTC" quantity: {significand: 15 exponent: -1}}`
21+ message Money {
22+ // A currency code.
23+ //
24+ // This may be a three-letter currency code defined in ISO 4217.
25+ //
26+ // APIs may define additional currency codes that are not included in the ISO
27+ // 4217 standard (for example, virtual currencies or cryptocurrencies). These
28+ // must start with "X-", in order to distinguish them from potential future
29+ // ISO 4217 codes.
30+ //
31+ // Examples:
32+ // "USD" - ISO 4217 code for United States dollar.
33+ // "X-BTC" - Potential API-defined extension for Bitcoin.
34+ // "X-RBX" - Potential API-defined extension for the virtual currency Robux.
35+ string currency_code = 1 ;
36+
37+ // The quantity of currency.
38+ Decimal quantity = 2 ;
39+ }
Original file line number Diff line number Diff line change 1+ # Money
2+
3+ The ` Money ` type represents an amount of money in a specified currency.
4+
5+ ## Schema
6+
7+ A ` Money ` has two fields:
8+
9+ - The ` currency_code ` field is a string containing a currency code.
10+
11+ The three-letter currency codes defined in the ISO 4217 standard are always
12+ supported.
13+
14+ APIs may define additional currency codes that are not included in ISO 4217
15+ (for example, virtual currencies or cryptocurrencies). These must start with
16+ with "X-", in order to distinguish them from potential future ISO 4217 codes.
17+
18+ Examples:
19+
20+ - "USD" - ISO 4217 code for United States dollar
21+ - "X-BTC" - Potential API-defined extension for Bitcoin.
22+ - "X-.RBX" - Potential API-defined extension for the virtual currency Robux
23+
24+ - The ` quantity ` field is a field of type [ ` Decimal ` ] [ ] , representing the
25+ quantity of currency.
26+
27+ ## Examples
28+
29+ - Five US dollars === ` {currency_code: "USD", quantity: {significand: 5}} `
30+ - One and a half Bitcoin ===
31+ ` {currency_code: "X-BTC", quantity: {significand: 15, exponent: -1}} `
32+
33+ <!-- prettier-ignore-start-->
34+ [ `Decimal` ] : ./decimal.md
35+ <!-- prettier-ignore-end-->
You can’t perform that action at this time.
0 commit comments