https://kotlinlang.org logo
#http4k
Title
# http4k
m

Matt

10/06/2021, 9:36 AM
Copy code
Could not find locale-lang in MyClass(localeLang=en)
org.http4k.contract.openapi.v3.NoFieldFound: Could not find locale-lang in MyClass(localeLang=en)
    at app//org.http4k.contract.openapi.v3.FieldRetrieval$Companion.compose$lambda-0(FieldRetrieval.kt:17)
    at app//org.http4k.contract.openapi.v3.AutoJsonToJsonSchema.toObjectSchema(AutoJsonToJsonSchema.kt:99)
    at app//org.http4k.contract.openapi.v3.AutoJsonToJsonSchema.toObjectOrMapSchema(AutoJsonToJsonSchema.kt:83)
    at app//org.http4k.contract.openapi.v3.AutoJsonToJsonSchema.toSchema(AutoJsonToJsonSchema.kt:36)
    at app//org.http4k.contract.openapi.v3.AutoJsonToJsonSchema.toArraySchema(AutoJsonToJsonSchema.kt:53)
    at app//org.http4k.contract.openapi.v3.AutoJsonToJsonSchema.makePropertySchemaFor(AutoJsonToJsonSchema.kt:146)
    at app//org.http4k.contract.openapi.v3.AutoJsonToJsonSchema.toMapSchema(AutoJsonToJsonSchema.kt:124)
    at app//org.http4k.contract.openapi.v3.AutoJsonToJsonSchema.toObjectOrMapSchema(AutoJsonToJsonSchema.kt:83)
    at app//org.http4k.contract.openapi.v3.AutoJsonToJsonSchema.toSchema(AutoJsonToJsonSchema.kt:36)
    at app//org.http4k.contract.openapi.v3.AutoJsonToJsonSchema.toArraySchema(AutoJsonToJsonSchema.kt:53)
    at app//org.http4k.contract.openapi.v3.AutoJsonToJsonSchema.toSchema(AutoJsonToJsonSchema.kt:35)
    at app//org.http4k.contract.openapi.v3.AutoJsonToJsonSchema.toSchema(AutoJsonToJsonSchema.kt:26)
    at app//org.http4k.contract.openapi.ApiRenderer$Companion$Auto$fallbackSchema$1.toSchema(ApiRenderer.kt:30)
    at app//org.http4k.contract.openapi.ApiRenderer$Companion$Auto$1.toSchema(ApiRenderer.kt)
    at app//org.http4k.contract.openapi.v3.OpenApi3.toSchemaContent(OpenApi3.kt:205)
    at app//org.http4k.contract.openapi.v3.OpenApi3.collectSchemas(OpenApi3.kt:141)
    at app//org.http4k.contract.openapi.v3.OpenApi3.responses(OpenApi3.kt:134)
    at app//org.http4k.contract.openapi.v3.OpenApi3.apiPath(OpenApi3.kt:108)
    at app//org.http4k.contract.openapi.v3.OpenApi3.asPath(OpenApi3.kt:94)
    at app//org.http4k.contract.openapi.v3.OpenApi3.description(OpenApi3.kt:70)
    at app//org.http4k.contract.ContractRoutingHttpHandler$descriptionRoute$2$1.invoke(ContractRoutingHttpHandler.kt:66)
    at app//org.http4k.contract.ContractRoutingHttpHandler$descriptionRoute$2$1.invoke(ContractRoutingHttpHandler.kt:66)
    at app//org.http4k.routing.RouterMatch$MatchingHandler.invoke(Router.kt:47)
    at app//org.http4k.routing.RouterMatch$MatchingHandler.invoke(Router.kt:46)
    at app//org.http4k.core.Http4kKt$NoOp$1$1.invoke(Http4k.kt:11)
    at app//org.http4k.core.Http4kKt$NoOp$1$1.invoke(Http4k.kt:11)
    at app//org.http4k.core.Http4kKt$NoOp$1$1.invoke(Http4k.kt:11)
    at app//org.http4k.core.Http4kKt$NoOp$1$1.invoke(Http4k.kt:11)
    at app//org.http4k.core.Http4kKt$NoOp$1$1.invoke(Http4k.kt:11)
    at app//org.http4k.core.Http4kKt$NoOp$1$1.invoke(Http4k.kt:11)
    at app//com.pret.food.extensions.ServerFilterExtensions$BasicForwardedAuth$invoke$1$1.invoke(ServerFilterExtensions.kt:43)
    at app//com.pret.food.extensions.ServerFilterExtensions$BasicForwardedAuth$invoke$1$1.invoke(ServerFilterExtensions.kt:36)
    at app//org.http4k.contract.ContractRoutingHttpHandler$identify$1$1$1.invoke(ContractRoutingHttpHandler.kt:105)
    at app//org.http4k.contract.ContractRoutingHttpHandler$identify$1$1$1.invoke(ContractRoutingHttpHandler.kt:103)
    at app//org.http4k.core.Http4kKt$then$2.invoke(Http4k.kt:15)
    at app//org.http4k.core.Http4kKt$then$2.invoke(Http4k.kt:15)
    at app//org.http4k.routing.RouterMatch$MatchingHandler.invoke(Router.kt:47)
    at app//org.http4k.routing.RouterMatch$MatchingHandler.invoke(Router.kt:46)
    at app//org.http4k.routing.RouterBasedHttpHandler.invoke(RouterBasedHttpHandler.kt:19)
    at app//org.http4k.routing.RouterBasedHttpHandler.invoke(RouterBasedHttpHandler.kt:13)
    at app//AppTest$3.invokeSuspend(AppTest.kt:31)
    at app//AppTest$3.invoke(AppTest.kt)
    at app//AppTest$3.invoke(AppTest.kt)
d

dave

10/06/2021, 9:44 AM
this was the version where we introduced OpenAPIJackson. Might be worth also checking the version of Jackson across the 2 verisons: https://www.http4k.org/changelog/#v41310
m

Matt

10/06/2021, 9:59 AM
4.13.0.0 and 4.13.1.0 both appear to use the same Jackson version (2.12.5)
d

dave

10/06/2021, 10:08 AM
then it must be the configuration of the OpenApiJackson instance. Suggest you investigate that because on the face of it, it's identical to the standard Jackson instance (apart from it doesn't serialise nulls). you can always swap it out for the standard
Jackson
instance if that turns out to be it
👍 1
m

Matt

10/08/2021, 3:16 PM
It turns out that I was using the standard
Jackson
instance in the first place so now I am really stumped.
d

dave

10/08/2021, 3:25 PM
can you put a repro together?
👍 1
m

Matt

10/11/2021, 2:51 PM
Only change to the code generated by the toolbox is to annotate the data class with
@JsonPropery
If you drop the version down to
4.13.0.0
the test passes
d

dave

10/11/2021, 3:57 PM
👍
well I know what it is. this is because of conflicting overloads and the OpenApi is now picking up the incorrect version of the AutoJsonToJsonSchema() function (which doesn't add the Jackson specific FieldRetrieval instances. Can you please raise an issue and will look at fixing it?
👍 1
Never mind - using this one: https://github.com/http4k/http4k/issues/667
👍 1
2 Views