RAML定义中的XML在任何点设计器中均不起作用

问题描述

我已经在anypoint api设计器中创建了一个资源。

#%rAML 1.0
. . . .
. . . .
/test-test:
  post:
   body:
    application/xml:
     type: myLib.grade

这是类型定义:

#%rAML 1.0 Library
types:
grade:
  type: object
  properties:
   desc: string
   students:
    type: student[]
    xml:
     wrapped: true

student:
  type: object
  properties:
    name: string

当我使用api designer的模拟进行测试时,我看到以下示例正文:

<?xml version="1.0" encoding="UTF-8"?>
<grade>
 <desc></desc>
 <students>
   <student>
     <name></name>
   </student>
 </students>
</grade>

但是当我运行它时,出现以下错误

{
"code":"REQUEST_VALIDATION_ERROR","message":"Invalid schema for content type application/xml. 
Errors: cvc-complex-type.2.4.a: Invalid content was found starting with element 
'{\"http://amf-xml-extension/\":student}'. One of '{\"http://amf-xml-extension/\":students}' 
is expected.. "
}

我认为我的类型def不正确,但是我看不出有什么问题。任何帮助将不胜感激。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)