小编bob*_*b k的帖子

如何在 OpenApi/Swagger/YAML 中使用保留关键字命名属性

鉴于已经存在一个特殊的“type”属性,它是一个保留关键字,有什么方法可以命名自定义属性“type”。

components:  
  schemas:  
  element:  
  type: object 
  properties:  
    name:  
      type: string  #type here is the keyword
    type: #type here is the actual name of the property!
      type: string
        enum:
          - radiogroup
          - checkbox
Run Code Online (Sandbox Code Playgroud)

无法修改生成 JSON 消息的后端系统来重命名属性。谢谢。

yaml swagger openapi surveyjs

5
推荐指数
1
解决办法
3302
查看次数

标签 统计

openapi ×1

surveyjs ×1

swagger ×1

yaml ×1