【问题标题】:Azure APIM - OpenApi: Format Integer not as StringAzure APIM - OpenApi:将整数格式化为字符串
【发布时间】:2021-06-17 05:24:18
【问题描述】:

在 Azure API 管理中,CustomerId 被指定为具有整数示例值的 整数

openapi: 3.0.1
components:
  schemas:
    Customer:
      type: object
      properties:
        CustomerId:
          type: integer
          format: int64
          example: 100000

保存后变为包含小数点分隔符的字符串:
示例:'100000.0'

openapi: 3.0.1
components:
  schemas:
    Customer:
      type: object
      properties:
        CustomerId:
          type: integer
          format: int64
          example: '100000.0'

如何指定整数示例值?

【问题讨论】:

    标签: openapi azure-api-management


    【解决方案1】:

    像下面截图这样写Sample(Json)后,它会自动生成Payload,我导出这个api,得到这样的yaml文件,能帮到你吗?

    components:
      schemas:
        Customer:
          type: object
          properties:
            CustomerId:
              type: integer
    

    【讨论】:

    猜你喜欢
    • 2011-09-27
    • 2023-04-06
    • 2010-10-20
    • 2010-10-16
    • 2011-05-04
    • 2011-08-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多