Conversation
And direction
sdelamo
left a comment
There was a problem hiding this comment.
This will be a breaking change. We have to do it for next mayor of AWS.
function-aws-api-proxy/build.gradle
Outdated
|
|
||
| dependencies { | ||
| annotationProcessor libs.micronaut.graal | ||
| annotationProcessor("io.micronaut.serde:micronaut-serde-processor:1.0.1") |
There was a problem hiding this comment.
I would recommend to update the build to 3.4.0, githubCoreBranch to 3.5.0 and use the serde version in the BOM.
| * @return Return the object mapper. | ||
| */ | ||
| protected abstract ObjectMapper objectMapper(); | ||
| protected abstract JsonMapper objectMapper(); |
There was a problem hiding this comment.
There is a import io.micronaut.serde.ObjectMapper;. Why not return it instead?
| */ | ||
| default ObjectMapper getObjectMapper() { | ||
| return getJsonCodec().getObjectMapper(); | ||
| default JsonMapper getObjectMapper() { |
There was a problem hiding this comment.
There is a import io.micronaut.serde.ObjectMapper; why not use instead of JsonMapper?
There was a problem hiding this comment.
JsonCodec returns a JsonMapper, which isn't an ObjectMapper 😔
|
|
||
| @Override | ||
| protected ObjectMapper objectMapper() { | ||
| protected JsonMapper objectMapper() { |
There was a problem hiding this comment.
why not use import io.micronaut.serde.ObjectMapper instead?
|
@yawkat can you provide feedback? |
| final Map<?, ?> node = lambdaContainerEnvironment.getJsonCodec().decode(Map.class, body.get()); | ||
| ((MicronautAwsProxyRequest) containerRequest).setDecodedBody(node); |
There was a problem hiding this comment.
We can't decode to a serde JsonNode here (it fails to create one), so I fell back to a Map. This will break if the body is not a map (ie: a simple json string), but I'm not sure if Lambdas can receive simple strings
|
The HateOas model doesn't seem to be coming through correctly... Notice the errors are not serialized with any properties... I've tried The model should look like this: |
|
@alvarosanchez Any idea how we migrate this to Serde serialization? The tests are checking for Jackson features which I don't believe we support in Serde |
|
This was the original reason for that code. If you are removing Jackson from here, then I don't think that feature is needed at all. Note that this change requires a new major version of the module. |
|
@alvarosanchez Thanks! We're well into new major version territory already, so that should be fine 👍 |
|
So here We send an AWS Serde fails to deserialize the request model as |
|
@graemerocher @yawkat I'm not sure how to use Serde to handle RequestEnvelope from AWS (see #1323 (comment) above) The class iteself and a lot of it's member classes use Which we don't support in Serde 🤔. Anyone got any ideas about getting round this? |
|
@timyates i would use a |
|
@yawkat Like this? I guess I need to mixin the whole tree of types before it will start working 😀 |
|
sure something like that. But yea looking at the other classes, this seems infeasible |
|
A custom deserializer is probably the simplest to be honest |
|
@graemerocher the classes only get bigger, see eg https://github.com/alexa/alexa-apis-for-java/blob/master/ask-sdk-model/src/com/amazon/ask/model/Context.java |
|
seems like we are going to have to add support for |
|
SonarCloud Quality Gate failed. |
|
Currently blocked by micronaut-projects/micronaut-serialization#176 |
|
The blocking issue seems closed; Any intentions to continue work on this? |









Started with function-aws-api-proxy to gather feedback
When I look at a scan for running the tests, I still see a LOT of Jackson, so I'm not sure if I'm doing the right thing
https://ge.micronaut.io/s/s7dmxjatvn6c4/dependencies?dependencies=fasterxml&expandAll