Skip to content

1.6.4返回ForestResponse默认会开启stream模式,导致读取失败 #226

@oonxt

Description

@oonxt

如题,

    @Get(url = "\${0}", decoder = ForestJacksonConverter::class, dataType = "json")
    @BodyType(type = "json", encoder = ForestJacksonConverter::class)
    @Success(condition = CommonCondition::class)
    @HttpClient
    fun <T, B> get(url: String, @JSONBody body: B, @Header headers: Map<String, Any>): ForestResponse<T>

get之后再用TypeReference读取时,会默认处理成stream。

1.5.36正常

com.dtflys.forest.exceptions.ForestHandlerException: com.dtflys.forest.exceptions.ForestHandlerException: com.dtflys.forest.exceptions.ForestConvertException: [Forest] json converter: 'ForestJacksonConverter' error: Unrecognized token 'stream': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')
at [Source: REDACTED (StreamReadFeature.INCLUDE_SOURCE_IN_LOCATION disabled); line: 1, column: 8]
at com.dtflys.forest.handler.ResultHandler.getResult(ResultHandler.java:222)
at com.dtflys.forest.reflection.MethodLifeCycleHandler.handleResultType(MethodLifeCycleHandler.java:129)
at com.dtflys.forest.reflection.MethodLifeCycleHandler.handleSyncWithException(MethodLifeCycleHandler.java:78)
at com.dtflys.forest.reflection.MethodLifeCycleHandler.handleSync(MethodLifeCycleHandler.java:62)
at com.dtflys.forest.backend.ResponseHandler.handleSync(ResponseHandler.java:39)
at com.dtflys.forest.backend.httpclient.response.HttpclientResponseHandler.handleSync(HttpclientResponseHandler.java:29)
at com.dtflys.forest.backend.httpclient.request.SyncHttpclientRequestSender.sendRequest(SyncHttpclientRequestSender.java:133)
at com.dtflys.forest.backend.httpclient.executor.HttpclientExecutor.execute(HttpclientExecutor.java:120)
at com.dtflys.forest.http.ForestRequest.execute(ForestRequest.java:5094)
at com.dtflys.forest.reflection.ForestMethod.invoke(ForestMethod.java:1521)
at com.dtflys.forest.proxy.InterfaceProxyHandler.invoke(InterfaceProxyHandler.java:236)

看源码,似乎这里少写了个return false;

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions