【发布时间】:2018-12-07 17:33:27
【问题描述】:
我们已升级到 Crowd Release 平台,现在正在创建 API 规范,这些规范使用 MuleSoft 推荐的片段。但是,我们可以导入 RAML,但不能生成流。没有错误 - 没有警告 - 没有。
我已经举了一个例子。
api.raml
#%RAML 1.0
version: v1
title: api
types:
contactDetails: !include library/types/contactDetails.raml
/contact:
post:
body:
application/json:
type: contactDetails
types-library.raml
#%RAML 1.0 Library
types:
telephoneNumber: !include ../exchange_modules/fragment-flows-problem-fragment/1.0.0/telephone-number.raml
contactDetails.raml
#%RAML 1.0 DataType
uses:
contactDetails: ../types-library.raml
properties:
name:
type: string
telephone:
type: contactDetails.telephoneNumber
电话号码.raml(片段)
#%RAML 1.0 DataType
description: |
**includes validation applicable to a contact telephone number**
***
- Minimum length 9
- Maximum length 15
type: string
displayName: Telephone Number
minLength: 9
maxLength: 15
pattern: ^[\d ]+$
examples:
telephoneNumber1: "01433000000"
telephoneNumber2: "01433 000000"
我只是补充一点,RAML 在设计中心和 Exchange 中都有效。
补充一句,如果我们去掉contactDetails.raml中的uses语句,那么contactDetails数据类型就无法识别了。
如果有人在这里指出问题或解释 Anypoint Studio 如何导入使用非常有用的片段的规范。
谢谢。
【问题讨论】:
标签: raml