Open Cedware opened 1 year ago
Thank you for the feedback @Cedware,
What I'm missing from the demo, though, is any Spring Cloud Function implementation that could be used inside the handler?
If your say that the 3.2.x
version worked can you please share the code?
I just looked at your sample and I am confused.
return request.createResponseBuilder(HttpStatus.OK)
.body(new TestResult("some string value"))
.header("Content-Type", "application/json")
.build();
Based on what I see this application does not use spring-sloud-function. I mean you are having it on classpath but you are not making any calls to s-c-function. Could you please clarify?
Describe the bug In my spring-cloud function project I want to modify the behavior of the json serializer. In version 3.2.x of this project, this was possible by providing a bean of the type ObjectMapper. With the current version (4.0.4) this does not seem to work anymore. I also tried to provide a bean of the type JsonMapper, but this has no effect as well.
Sample
I provided a small example in this repository: https://github.com/Cedware/cloud-function-demo
In the CloudFunctionDemoApplication class I created a JsonMapper bean, where I configured the ObjectMapper to use snake case naming. The demo application can be started by running
mvn package
followed bymvn azure-functions:run
After the application has started, you can send a get request to http://localhost:7071/api/test.Since I configured the JsonMapper to use snake case naming, I expect the response to look like this:
But the actual result looks like this: