#DTO field mapping from JSON
1 messages · Page 1 of 1 (latest)
@hoary cape
If no response in a reasonable time, ping @Member.
To close, type !solve or byte solve.
Please include an MCVE so that we can reproduce your issue locally.
What do you type the field as on your model? That’s what the dto would be working off, e.g., json_field: Mapped[dict] = mapped_column(JSON) - dto would to/from a dict.
That is it, yeah. Can I just supply more typing information somehow?
I.e. could I say it's a dict with these keys inside?
To be more specific: if my JSON field is a list of dicts, each with 2 mandatory keys in, could I somehow tell the dto_factory that those keys will exist, and to expose them in the API documentation output?
maybe a typed dict? have you tried it?
I tried a couple of things, but without success. I had to get this in in time, so I just rewrote as another table with a foreign key.
byte solve