gecBurton / djangorestframework-jsonschema

djangorestframework-jsonschema
ISC License
6 stars 0 forks source link

nested writable serializers unsupported #7

Open gecBurton opened 4 years ago

jacksmith15 commented 4 years ago

these aren't actually supported by DRF out-of-the-box:

Because the behavior of nested creates and updates can be ambiguous, and may require complex dependencies between related models, REST framework 3 requires you to always write these methods explicitly. The default ModelSerializer .create() and .update() methods do not include support for writable nested representations.

so its not unreasonable to just warn about these, or perhaps auto-generate a TODO comment

It could be an optional feature, with the added dependency of https://github.com/beda-software/drf-writable-nested

gecBurton commented 4 years ago

im not 100% sure these are needed tbh... and they are at direct odds with json-api.

my feeling as that these are a very-nice-to-have option. Experimenting with the fhir spec reveals all sorts of hidden horrors re: POST/PUT conflicts... maybe one for 1.0.0

jacksmith15 commented 4 years ago

I don't think they are necessarily at odds with json-api if the nested objects are within the resource's attributes rather than relationships