如何在RAML中将REST服务标记为已弃用

时间:2016-06-21 11:35:05

标签: raml

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

1 个答案:

答案 0 :(得分:4)

RAML 0.8缺乏这个概念。 RAML 1.0将Annotations添加到全局部分以传达这样的元数据。

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.