如何在DSL JSON中进行注释处理期间启用未知类型

我正在尝试在Java项目中使用dsl-json进行反序列化,并且在maven编译期间遇到此错误:

"Property x is referencing unknown type: y which has an unknown part: z. Register custom converter,mark property as ignored or enable unknown types"

我可以通过在属性/获取器上放置@JsonIgnore来避免这种情况,但是我认为有太多的属性会更容易启用未知类型。我怎样才能做到这一点。我正在使用Java 8,Maven 3.5.0和日食氧气。

gdfg3ggf 回答:如何在DSL JSON中进行注释处理期间启用未知类型

您可以这样设置编译器选项dsljson.unknown = ALLOW

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.8.1</version>
    <configuration>
        <compilerArguments>
            <Adsljson.unknown>ALLOW</Adsljson.unknown>
        </compilerArguments>
    </configuration>
</plugin>

然后使用内置分析器初始化DslJson

new DslJson<>(Settings.withRuntime().includeServiceLoader()
本文链接:https://www.f2er.com/3012078.html

大家都在问