I am looking for a way to build a model Foo
below, where serializing does not produce nesting (and of course Foo
still does validation)
Desired behaviour: bar
is validated according to Foo
.
y = Bar(bar=Foo('xxx'))
Desired output:
print(y.json())
# {"bar": "xxx"}