货币的类型是什么?
What is the type for currency?
我找不到关于这个主题的 a sample of currency data type in the object definition, nor a document。
有no built-in "currency" type。您通常会使用 type: number
和可选的 format
修饰符来指示数字类型的含义:
type: number
format: currency
format
可以有任意值,因此您可以使用 format: currency
或 format: decimal
或您的工具支持的任何值。识别给定 format
的工具会将值映射到相应的类型。
类型在OpenAPI 2.0 standard closest to typical decimal dollar values seems to be type number, format float, which is a 32-bit floating point format (see other online discussions such as here)
我找不到关于这个主题的 a sample of currency data type in the object definition, nor a document。
有no built-in "currency" type。您通常会使用 type: number
和可选的 format
修饰符来指示数字类型的含义:
type: number
format: currency
format
可以有任意值,因此您可以使用 format: currency
或 format: decimal
或您的工具支持的任何值。识别给定 format
的工具会将值映射到相应的类型。
类型在OpenAPI 2.0 standard closest to typical decimal dollar values seems to be type number, format float, which is a 32-bit floating point format (see other online discussions such as here)