【问题标题】:How to mark a REST service as deprecated in RAML如何在 RAML 中将 REST 服务标记为已弃用
【发布时间】:2016-10-22 22:29:20
【问题描述】:

我们正在更新我们的 RAML 0.8 规范,我们希望将一个方法标记为已弃用并指向同一 API 中的另一个方法。在 RAML 中可能吗?我看了一些文章,但不清楚它是否已经实现了

【问题讨论】:

    标签: raml


    【解决方案1】:

    RAML 0.8 缺少这个概念。 RAML 1.0 将注释添加到全局部分以传达此类元数据。

    P.S.:一个示例弃用注释

    deprecated:
      properties:
        replaceWith:
          type: string
          description: |
            Describe the alternative resource/method that can be used as a substitute.
          required: true
        since:
          type: string
          pattern: (0[1-9]|10|11|12)/20[0-9]{2}
          required: true
          description: Describe when the resource/method became deprecated in the format (mm/YYYY)
      allowedTargets: [Resource, Method]
      displayName: Deprecated
      description: |
        A deprecated resource or method is *not* recommended for new work.
        The resource or method will be removed in a future version of the API.
    
        Deprecation does NOT mean it is not supported anymore in the current version.
    

    【讨论】:

    • 感谢您的回答!我进一步检查了,确实如您所说
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-18
    • 1970-01-01
    • 1970-01-01
    • 2014-08-20
    • 1970-01-01
    • 2017-02-18
    相关资源
    最近更新 更多