You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes flatten is not supported at least yet. To support this there is actually couple of things could be done and there is no need to have #[component(nested = true)] necessarily.
a) If component have #[serde(flatten)] attribute the component could be transformed to AllOf type which then contains the own schema inlined and the references to the other schemas. But then it means that the ExtraContent need to be Component as well.
b) If component will have the #[serde(flatten)] then propably runtime ther should be custom modifier which does handle this nested mangling of types by copying the properties from nested type to the actual type etc. And similarly the ExtraContent should be a Component as well.
I would prefer the a) since its simplier solution and works well with the compile time design. b) at the other hand needs some hacks and takes a toll with performing some schema mangling at runtime, but would not use AllOf composite type and all properties would be directly under the SomePayload itself.
I would be ok with anything solving this but sure a) detection would be really great and for the side note I already deal with ExtraContent as a Component which to me is not an issue.
If we design a struct with the special instruction
flatten
ofserde
it is not flatten during schema creation.So would it be possible to tackle that point, maybe like the example, format, write_only?
The text was updated successfully, but these errors were encountered: