0

I didn't found any suitable example where Example is being used as DataType properly inside main RAML file. Mostly it's being used as .json/.xml file. Is there any proper detail or reference where I could find that. Using AnyPoint Platform design center to build RAML.

Below pasting screenshot of selection point where we can select Example as DataType.

enter image description here

4

1 回答 1

0

文档中有一个页面专门用于定义示例的方法(RAML 1.0 中定义示例指南)。我想所要求的是如何使用 NamedExample 的示例:

api.raml:

#%RAML 1.0
title: test
types:
  A:
    properties:
      givenName: string
      familyName: string
    examples: !include fragment.raml

片段.raml:

#%RAML 1.0 NamedExample
fullName:
  givenName: ”Chiaki”
  familyName: "Mukai"

otherFullName:
  givenName: "Kyung-won"
  familyName: "Park"

我建议还阅读RAML 1.0 API 规范中发现的常见问题页面,该页面还描述了尝试错误使用示例时的一些常见错误以及如何解决这些错误。

于 2021-09-28T15:48:13.017 回答