Open kubukoz opened 2 years ago
wut, I wasn't aware apply
was a possibility in the json syntax. You are correct in what needs to happen though. Mind PR-ing it in ?
If nobody beats me to it :) I'll assign myself here if I pick it up
Looks like #463 resolves this for my purpose (apply
simply doesn't get generated, it seems), but since it's an actual decoding failure (and not simply an ignored field) I'd say we should still do something about this, so that Dynamic can read models serialized by plain Smithy tooling without flattening.
We need a pre-processing step, that would inline the apply. We also need a pre-processing step that would inline the mixins. It's really doable, just a bit tedious.
Just to be clear, this would be part of the dynamic model compiler? Essentially replicating what we're now doing in the part that serializes the jvm smithy model?
Yes. But as isolated function Model => Model
function that could be run in isolation.
Running
dump-model
on this results in the following shape being generated (among others):Decoding it fails with:
I think that shape should not be generated, but instead the target field should have a trait added to it. Currently it's impossible to load a dynamic model that was dumped from anything with an
apply
in it.