代码之家  ›  专栏  ›  技术社区  ›  Jev Björsell

在apiary.io markdown中指定属性数据类型的约定是什么?

  •  3
  • Jev Björsell  · 技术社区  · 11 年前

    apiary.io以点形式列出资源属性。是否有特定的约定来显示这些属性是什么数据类型,或者满足数据指定格式?

    1 回复  |  直到 11 年前
        1
  •  2
  •   Zdenek    11 年前

    目前,API蓝图中还没有讨论资源属性的约定。接近的是 计划 Message-body Attributes Description .

    但我觉得真正的解决方案是未来API蓝图的概念 Resource Blueprint 根据 语义数据定义 (指资源)。请参阅 example resource blueprint .

    因此,尽管前面的任何一个都没有实现,但如果您正在寻找一个约定,我建议考虑资源蓝图中提出的约定,例如:

    # Resource [/resource]
    
    ## Attributes
    
    + ip (string) ... ipv4 or ipv6 address associated with the resource
    + some-other-attribute (number, optional, `42`) ... a number of something
    
    推荐文章