标签: raml-java-parser

Java Map的RAML 1.0表示

我有RAML架构,其中包含 "javaType": "java.util.Map<String, java.util.List<Employee>>"

我有单独的架构(employee.schema)可用,它代表类Employee.

但是因为我没有在raml中使用employee.schema所以它不会生成类Employee并在将RAML转换为Java时抛出错误.

{
  "$schema": "http://json-schema.org/schema#",
  "type": "object",
  "description": "Desc",
  "properties": {
    "employeeGroups": {
      "type": "object",
      "javaType": "java.util.Map<String, java.util.List<Employee>>"
    }
  },
  "additionalProperties": false
}
Run Code Online (Sandbox Code Playgroud)

任何人都可以分享评论如何"javaType": "java.util.Map<String, java.util.List<Employee>>"在RAML中表示吗?

RAML Version: 1.0
Run Code Online (Sandbox Code Playgroud)

java raml raml-java-parser raml-1.0

17
推荐指数
1
解决办法
373
查看次数

从 Spring MVC 控制器自动将 REST api 文档生成到 RAML 中

我是 Spring Boot 的新手。我想从 Spring MVC 控制器自动将 REST api 文档生成到 RAML 中。有什么可以做的吗?或者有什么指南可以让我用它来将我的 REST API 生成到 RAML 中?

spring raml raml-java-parser spring-restdocs spring-auto-restdocs

5
推荐指数
1
解决办法
2496
查看次数

Raml验证程序在javax.xml.validation.SchemaFactory.newSchema中引发错误

当尝试验证espn.raml时,出现以下错误。相同的代码对于gmail.raml可以正常工作。为什么会这样呢?供您参考,我提供了结果,发现了SchemaFactory包含的jar。

$查找* .jar | xargs grep SchemaFactory.class二进制文件

axiom_1.2.11.wso2v6.jar匹配二进制文件

org.apache.openjpa_2.2.0.wso2v1.jar匹配二进制文件

solr_5.2.1.wso2v1.jar匹配

这是我得到的例外:

Caused by: java.lang.LinkageError: loader constraint violation: when resolving method "javax.xml.validation.SchemaFactory.newSchema(Ljavax/xml/transform/Source;)Ljavax/xml/validation/Schema;" the class loader (instance of org/eclipse/osgi/internal/baseadaptor/DefaultClassLoader) of the current class, org/raml/parser/rule/SchemaRule, and the class loader (instance of <bootloader>) for resolved class, javax/xml/validation/SchemaFactory, have different Class objects for the type m/Source;)Ljavax/xml/validation/Schema; used in the signature
    at org.raml.parser.rule.SchemaRule.doValidateValue(SchemaRule.java:118)
    at org.raml.parser.rule.SchemaRule.doValidateValue(SchemaRule.java:48)
    at org.raml.parser.rule.DefaultTupleRule.validateValue(DefaultTupleRule.java:108)
    at org.raml.parser.visitor.YamlDocumentValidator.onScalar(YamlDocumentValidator.java:115)
    at org.raml.parser.visitor.NodeVisitor.visitScalar(NodeVisitor.java:256)
    at org.raml.parser.visitor.NodeVisitor.visit(NodeVisitor.java:222)
    at org.raml.parser.visitor.NodeVisitor.visitResolvedNode(NodeVisitor.java:180)
    at org.raml.parser.visitor.NodeVisitor.doVisitMappingNode(NodeVisitor.java:151)
    at org.raml.parser.visitor.NodeVisitor.visitMappingNode(NodeVisitor.java:86)
    at org.raml.parser.visitor.NodeVisitor.visit(NodeVisitor.java:218)
    at …
Run Code Online (Sandbox Code Playgroud)

yaml maven-2 osgi-bundle raml raml-java-parser

3
推荐指数
1
解决办法
485
查看次数