【问题标题】:How to resolve problem with JsonSchemaValidator?如何解决 JsonSchemaValidator 的问题?
【发布时间】:2019-11-06 10:39:51
【问题描述】:

无法使用 JsonSchemaValidator。请帮助解决此错误。或者它可能是库错误? 我的测试代码:

Response resp = given().cookie(cookie).when().get(getEndpointLink("link_menuItems"));
resp.then().assertThat().body(matchesJsonSchemaInClasspath("jsonSchema.json"));

依赖关系:

compile group: 'io.rest-assured', name: 'json-schema-validator', version: '4.1.2'
compile group: 'com.github.fge', name: 'json-schema-core', version: '1.2.5'
compile group: 'com.github.fge', name: 'json-schema-validator', version: '2.2.6'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.10.0'
compile group: 'com.github.fge', name: 'jackson-coreutils', version: '1.8'

错误:

java.lang.IncompatibleClassChangeError: Found class com.github.fge.jsonschema.main.JsonSchema, but interface was expected

【问题讨论】:

    标签: java json rest-assured json-schema-validator


    【解决方案1】:

    请检查您的库路径中是否存在 json-schema-validator-2.2.8.jar。在 2.2.8 版本中,他们将 JsonSchema 类转换为接口。

    【讨论】:

      猜你喜欢
      • 2011-10-25
      • 2018-07-07
      • 2019-01-30
      • 2019-09-21
      • 2021-09-10
      • 2019-12-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多