货币的类型是什么?

时间:2017-09-21 18:16:31

标签: swagger swagger-editor openapi

我无法在对象定义中找到a sample货币数据类型,也无法在主题上找到a document

2 个答案:

答案 0 :(得分:3)

no built-in "currency" type。您通常会使用type: number和可选的format修饰符来指示数字类型的含义:

type: number
format: currency

format可以包含任意值,因此您可以使用format: currencyformat: decimal或您的工具支持的任何内容。识别给定format的工具会将值映射到相应的类型。

答案 1 :(得分:-1)

最接近典型十进制美元值的OpenAPI 2.0标准中的类型似乎是数字类型,格式为 float ,这是一个32位浮点格式(参见其他在线讨论,如here

相关问题